hello friends welcome to advanced
WordPress video tutorials by perfect web
solutions
my name is Imran Qasim and in today's
video tutorial we are going to learn
about debugging in WordPress so if
you are a wordpress designer or if you
are a WordPress developer, you should know
the tools used in WordPress to debug
your code or any other person's code for
WordPress designer if you are supposed
you are a WordPress designer and you're
designing a website in WordPress using
third-party themes and plugins so you
should know that that particular theme
or that particular plugin or even that
particular snippet you're using inside
your WordPress is or having a proper
coding structure plus having the proper
coding function and it does not have any
error warning any notice or any
deprecated WordPress function what do I
mean by deprecated WordPress Function.if you are using current
versions which is currently i think is 4.8 so
there are many
coding standards which are not
followed inside WordPress so those code
or those function or those methods are
deprecated in current version so if you
download any theme or or any plug-in you
should know when does this WordPress Theme
or plug-in is created or launched or
updated so knowing this will help you to
understand that whether this particular
snippet particular function particular
theme or plugin is fully compatible with
your current version of WordPress
debugging in WordPress is very easy
anyone can do it even if you are a coder
or if you are designer you just need to
enable some tools inside WordPress but
keep in mind some of them you can enable
on your public release of your WordPress
site I mean if your site is live then
some of them you can use there but
someone some of them you should don't
use that them on the live server or on a
public server
 because it will create a
problem for your viewers so you don't
want to create problem for your viewer
but at the same time you want to solve
those problems in your website which is
created using WordPress so let's get
started. so debugging in WordPress. debugging
a PHP code is a part of any project or
project plan as it's written here but
WordPress comes with appropriate
debugging system designed to simplify
the procedure also it will standardise code across your WordPress
installation plug-ins and themes here in
this particular slide I will go you show
you various debugging equipment used in
WordPress and the bear to be more useful
to you coding and addition to growing
the satisfactory and inter portability
of your code so in this degree tool the
first tool is WT debug what this two
will do it will show you the errors the
warning notices even it will show you
the deprecated methyl function inside
WordPress which is used in any theme or
in any plugin so this would by default
it is set to false so it will not show
any error or warning or any duplicated
information but sometimes if you do see
a white cream or it is also I call it
white screen of death if you see that
screen you have no way to know that
what's going on what is happening behind
the scenes while you are seeing this
white screen how to resolve it vary the
error so this tool is or this immersive
function or this constant is an
appropriate for you if you enable this
in your WordPress installation make sure
this WP debug is only enabled inside
your death version of your work as not
in the light server otherwise you will
get lots of loss of users problem not
you maybe your user will get notices and
this will
some hackers to attack your side at to
make sure WP debugging the neighbors
only on that version or on that side
which is showing and the construction
there are under construction plugin as
well there are construction code as well
as you can put your work beside in under
construction
so this WP debug I will show you later
how to use it and how to imply it so you
can define it true or false by default
it is false so you don't see any warning
any error any notice of any application
of information the second is WP debug
log comparative to WP debug this is more
secure for the developers because you
can use this code on your life server
but it will not show the error but if we
create a log file in your WordPress root
installation with the name of debug dot
log and you can daily check that file
whether are you going to get any error
or warning or if there is any function
which god deprecated and is not
compatible with your current version of
workers so you can
by default this WP debug log is also
false so you can make it true on your
life 0 but make sure you regularly check
and clear the code and also clean the
filer otherwise this file side will be
gradually included in cleanest will
become a huge file and will eat your
resources or disk space on the live
server effort so keep checking on it if
you have enabled the BP debug I will
show you later how to enable it as well
so in the next we have deep blue WP
debug display suppose you have an able
WP debug or WP debug log but at the same
time you don't want to display those
error on the screen warning on the
screen duplicated code on the field so
then you can make this WP debug display
to false by default this one is true if
you enable the blip in debug proof it is
also become true so
you can make it false as well so this
one is also good to to hide the code
which you are shown on the screen next
it skipped a debug script big bug is
very handy in the development
environment normally worked as you
minified versions of your CSS and
JavaScript code but if you never script
debug to what it will do it will use the
normal version of that suppose there is
a jQuery plug-in which is minified
inside water but if you use script debug
it will use the standard version which
is not many but this is also helpful for
you to check a Jack Sparrow or any word
script error or you can diagnose where
is the problem and you can resolve it so
script debug is for CSS and javascript
error evolving and other things
next is save goodies you have running
you are running many SQL cuties behind
the thing and you don't know what
precedence so it works is running them
many cuties or you created a plug-in or
you downloaded a plugin are you using a
plug-in which is securing your database
so you will when you enable the saved
duties it will save all those key in a
log file for you so you can analyze
those cuties and see that whether this
beauty is returning the proper result or
not or if it does give you some extra
resource already taking extra resources
or displaying or showing extra
information you can see in that log file
as well so let's this end let's end the
slide here and let's get to the actual
code and let me show you that on the
WordPress how we can enable these codes
so it is very easy you just need to go
your WordPress installation like I have
local boost or installation I will go to
WP admin and I'm sorry for my server is
not running so I'm on the local machine
so let me yeah no Masai very many and
let me close this flight and also I have
loaded the same word as complete
worthless here on my favorite text
editor which is up like that and then
you need to open WP config dot PHP file
in your editor and you put all those
codes here suppose I have put here WP
debug true so what does that mean now
debugging is enabled so if I go to my WT
admin if there is any error warning it
will be shown on the screen
I take some time to load my head my
dashboard because sometimes it does
happens here I don't see any other here
on the front end you don't see any other
because I am not using too many plugins
my book on base is updated but Kings all
of them are updated you don't see any
updates notification here so everything
is updated there was a king which
someone of my client has given me I'm
sure he's watching this video as well so
he gave me a king this let me show you I
think if I haven't deleted it yep I'm
sorry I have deleted that thing but
anyways let's get a team from
wordpress.org over all the kings and see
if we can find any duplicated code
people mostly search for the latest
things but here we are going to search
for some old things or maybe that means
find
so let me blog and such a thing anyway
I'm sure you will understand that what
exactly do I mean so what you can do
just them like that define the GP debug
to do and at the same time if I show you
you can just simply put the there are 1
2 3 4 5 ports so you can duplicate this
four times or totally there are five you
can then copy this WP back log paste it
here that will be debug display so to
hear the script be back rest here is
curative and
Vasek you have defined everything so let
me go to my psyche the see there is no
problem at all and now we need to find
WP debug debug dot log file so this file
will be on your life server ever if
there is an error of warning and right
now there is no error no warning so let
me create a class ships okay let me do
that this one for you so I will go to
clean editor and then I will go to its
function dot PHP file so as you may know
that classes like if I define class my
custom class and I'm here I will call it
my custom this is just a demo code it
will be a duplicate record so here a
previous version of PHP you can define a
class like this function my custom class
and here
we can do like something eco custom my
custom can splatter so this is a custom
constructor if everything was really I
forgot to put a tiny volume naturally
our beginning into each other so I run
it and it is saved and no my custom
classic created and now if I go to NGC
if I go to dashboard and enter my son
tank you will see here it is showing and
ayah is gusto
this one is booster and if I can show
you
and if I can also do another thing
that then that we reject WP widgets the
hunter
so this is warning see this is warning
has been shown so if I disable comment
on this code and so you see there is
another bombing has been gone and but
you can see there is another error it
coming so I can
I think this era no I can only solve by
going into my current team this is aa it
is a super fasty nice fear okay so it is
my twenty thousand watch are they
function and which is good for a custom
class extend the mat extend extend
so either we loaded publicly ventured at
accessibility
and now I will initialize it add action
emit comma and here we can put a clause
in my custom class and let me show you
know our eyes shown here so let's enable
debug mode I will do this for a load a
bit more I'm sorry
we need to just check this one only and
let me connect it at a given debacle and
then we can do your own coin here
function dot PHP I'm making the first
side to my custom class
and now you see the black space it is
hiding back there we did somewhere let
me see if I can show you in the front
end you Patos well I decided to get team
so this one is involved and if I go to
King's here looking let me activate this
super fast and easy this error is coming
when I'm activating the key also this
thing is not compatible with who calmed
us and let me show you what was the
problem please see so if I go to its
metal boxes it's inside I'll go set with
chips it was in the cell widgets yeah
here I have changed it to construct to
solve this problem but it was like this
seriously and it was also little adults
as classes that design it was like this
so this is active and I will activate
different
and now I'm going to activate this to
fuckin say this WD defined activity back
to ya which is perfectly fine so it was
showing over here that this function is
deprecated I'm not sure why it is logged
in the debug log safely invested so
defined of the into vodka now now you
see these errors undefined index so
these are the things which should be
covered and let me show you if I'd not
disable or make it false here you won't
see the undefined error anymore you see
they are gone but they are there so this
is what I'm trying to tell you if you
make it crew you will feed those others
yeah but if it is not true or if it's
false or not added it will not show you
those leaders so this is what I mean by
development so I will show you another
one here I will do this and let me
comment out this so the bug is false
and log is true so now it is not showing
any other but still it will create a
debug log file
yeah here it is it has created inside
wp-content folder a debug dot log and
you will see all of the errors here
which are shown inside we see it is
showing here that the blue team attack
app was called incorrectly job listing
is not registered any there are many HP
notices this you can see here and you
can rectify them as you as being a
developer or you can hire if you Ameri
developer your designer you can hire
another developer to solve these issues
or you can change your team giving
update your plugin to solve this kind of
problem as well so now you see the but
third log is created because of you I
have enabled in my WP config file I have
enabled debug log is true and this one
is showing here so I by anybody's safety
and let me clear this file debug log
file let me clear it I now reload it and
you will see
again not adding any body so and making
sure
Center yeah here they came again and see
how you can find the errors in your live
site without using WP debug and I must
recommend that if you are designing for
someone or if you are designing for
yourself then create two version of your
website one is a damn version one is a
public version so whenever you try a
plug-in try it before with the diversion
and your dev version must not be
publicly available we should put an
under-construction version and just I'll
name it just death that is the devil and
it's under construction and after you
checked and because if it's under
construction and you are logged in as
admin you can see your site fully
working what is the meaning of under
construction is that if you put your
site under construction it will not be
publicly available
no one can see what's going on your
website apart from seeing a page which
is showing we will be back soon or
something any message or something like
that but if you log in with your admin
account you can see your site like you
are watching it or using it as a public
version so I'm sure this video will be
very helpful for you to understand that
why these tools are important in your
WordPress development or designing
carrier even if you are a novice design
a Bignell designer or beginner developer
otherwise the devil provide one key well
as you should know and you may know
already but you should know that these
tools must be enabled inside your dev
version only after checking plugin team
you can put them on your life or you can
put them for sale app if you are
developing a plugin for selling purpose
he should consider and remove all
methods which are deprecated or which
are remove all of your warning notices
and errors from the plugin orphan
routine and then launch it for public
and continuously keep an eye on update
software
WordPress and make desire changes and
launcher updates so that your buyers who
bought that plug-in or bought that theme
will be satisfied with you that you are
updating it continuously and supporting
them and giving them what the pest can
give with your team or plugin so this
will grow your plugin and your team ever
so I'm sure this video is very helpful
with you if you haven't subscribed to my
channel please consider subscribing it
now and don't forget to like the video
and testable I can because that but I
can will help you whenever I upload a
new video for new tutorial or new
information you will get the
notification so thank you very much once
again
take care Allah Hafiz and bye
