Solution -> Fatal error: Allowed memory size exhausted wp-includes/class.wp-dependencies.php on line 339

Recently one of our Managed WordPress Services clients came to me to describe a problem with a WordPress site they were working on.

If you need in depth help debugging an erro on your WordPress of PHP site,  contact us.

They were receiving an error: Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 71 bytes) in /***REDACTED_PATH***/wp-includes/class.wp-dependencies.php on line 339

The client described that they had not done any kind of upgrades or changes to cause the issue and asked about whether we did any upgrades as part of the weekly site reviews we do under the Managed WordPress Service.   I found in the weekly email report sent by another person in our office,  that we had done some upgrades,  however the file that was throwing the error (class.wp-dependencies.php) had not been updated.   So I had to dig in deeper to find the root cause.

I ended up writing some debugging code that I placed directly in class.wp-dependencies.php that helped me to identify some of the causes.    Because I found lots of other sites when googling that had the same error, I decided I would post the debugging code,  in the case that it helps other users debug their issue.   The issue ended up being that site had an enqueued script jquery which   dependency on jquery-migrate which in turn had a dependency on jquery.  This circular reference looped in the WP code until the server ran out of memory. (in this case it was about 128MB).

The theme and plugins had two locations which enqueued  jquery scripts,  one was enqueud BEFORE a dependency existed,  then a dependency was created and the script was queued again. The code I wrote is intended for debuggin purposes,   because the the issue could easily come from other issues,  and I wanted to see the backtrace for exactly where the problematic scripts (jquery, jquery-migrate) were queued from.

Here is the output from my code:


MATRAEX Debugging Code This WordPress project has circular dependencies
Aborting script execution at /***PATH_REDACTED***/wp-includes/class.wp-dependencies.php:400
Debugging tip look for theme code that calls ‘enqueue’ on for items which already have dependencies)
If this error did not show, your script would have likely errored on line 339 when it ran out of memory from the circular debugging.
Most likely this is a plugin error!!


jquery has a dependency on jquery-migrate which has a circular dependecy on jquery
Backtrace of when jquery was enqueued:
Instance 0:

#0  WP_Dependencies->enqueue(jquery) called at [/***PATH_REDACTED***/wp-includes/functions.wp-scripts.php:276]
#1  wp_enqueue_script(jquery, http://dev.art4healing.org/wp-content/plugins/jquery-updater/js/jquery-3.1.1.min.js, , 3.1.1) called at [/***PATH_REDACTED***/wp-content/plugins/jquery-updater/jquery-updater.php:26]
#2  rw_jquery_updater()
#3  call_user_func_array(rw_jquery_updater, Array ([0] => )) called at [/***PATH_REDACTED***/wp-includes/plugin.php:524]
#4  do_action(wp_enqueue_scripts) called at [/***PATH_REDACTED***/wp-includes/script-loader.php:1197]
#5  wp_enqueue_scripts()
#6  call_user_func_array(wp_enqueue_scripts, Array ([0] => )) called at [/***PATH_REDACTED***/wp-includes/plugin.php:524]
#7  do_action(wp_head) called at [/***PATH_REDACTED***/wp-includes/general-template.php:2555]
#8  wp_head() called at [/***PATH_REDACTED***/wp-content/themes/Parallax-One/header.php:19]
#9  require_once(/***PATH_REDACTED***/wp-content/themes/Parallax-One/header.php) called at [/***PATH_REDACTED***/wp-includes/template.php:572]
#10 load_template(/***PATH_REDACTED***/wp-content/themes/Parallax-One/header.php, 1) called at [/***PATH_REDACTED***/wp-includes/template.php:531]
#11 locate_template(Array ([0] => header.php), 1) called at [/***PATH_REDACTED***/wp-includes/general-template.php:45]
#12 get_header() called at [/***PATH_REDACTED***/wp-content/themes/Parallax-One/front-page.php:5]
#13 include(/***PATH_REDACTED***/wp-content/themes/Parallax-One/front-page.php) called at [/***PATH_REDACTED***/wp-includes/template-loader.php:75]
#14 require_once(/***PATH_REDACTED***/wp-includes/template-loader.php) called at [/***PATH_REDACTED***/wp-blog-header.php:19]
#15 require(/***PATH_REDACTED***/wp-blog-header.php) called at [/***PATH_REDACTED***/index.php:17]

Instance 1:

#0  WP_Dependencies->enqueue(jquery) called at [/***PATH_REDACTED***/wp-includes/functions.wp-scripts.php:276]
#1  wp_enqueue_script(jquery) called at [/***PATH_REDACTED***/wp-content/plugins/nextgen-gallery/nggallery.php:513]
#2  C_NextGEN_Bootstrap->fix_jquery()
#3  call_user_func_array(Array ([0] => C_NextGEN_Bootstrap Object ([_registry] => C_Component_Registry Object ([_searched_paths] => Array ( .......
#4  do_action(wp_enqueue_scripts) called at [/***PATH_REDACTED***/wp-includes/script-loader.php:1197]
#5  wp_enqueue_scripts()
#6  call_user_func_array(wp_enqueue_scripts, Array ([0] => )) called at [/***PATH_REDACTED***/wp-includes/plugin.php:524]
#7  do_action(wp_head) called at [/***PATH_REDACTED***/wp-includes/general-template.php:2555]
#8  wp_head() called at [/***PATH_REDACTED***/wp-content/themes/Parallax-One/header.php:19]
#9  require_once(/***PATH_REDACTED***/wp-content/themes/Parallax-One/header.php) called at [/***PATH_REDACTED***/wp-includes/template.php:572]
#10 load_template(/***PATH_REDACTED***/wp-content/themes/Parallax-One/header.php, 1) called at [/***PATH_REDACTED***/wp-includes/template.php:531]
#11 locate_template(Array ([0] => header.php), 1) called at [/***PATH_REDACTED***/wp-includes/general-template.php:45]
#12 get_header() called at [/***PATH_REDACTED***/wp-content/themes/Parallax-One/front-page.php:5]
#13 include(/***PATH_REDACTED***/wp-content/themes/Parallax-One/front-page.php) called at [/***PATH_REDACTED***/wp-includes/template-loader.php:75]
#14 require_once(/***PATH_REDACTED***/wp-includes/template-loader.php) called at [/***PATH_REDACTED***/wp-blog-header.php:19]
#15 require(/***PATH_REDACTED***/wp-blog-header.php) called at [/***PATH_REDACTED***/index.php:17]

jquery-migrate has a dependency on jquery which has a circular dependecy on jquery-migrate
Backtrace of when jquery-migrate was enqueued:
Instance 0:

#0  WP_Dependencies->enqueue(jquery-migrate) called at [/***PATH_REDACTED***/wp-includes/functions.wp-scripts.php:276]
#1  wp_enqueue_script(jquery-migrate, http://dev.art4healing.org/wp-content/plugins/jquery-updater/js/jquery-migrate-3.0.0.min.js, Array ([0] => jquery), 3.0.0) called at [/***PATH_REDACTED***/wp-content/plugins/jquery-updater/jquery-updater.php:32]
#2  rw_jquery_updater()
#3  call_user_func_array(rw_jquery_updater, Array ([0] => )) called at [/***PATH_REDACTED***/wp-includes/plugin.php:524]
#4  do_action(wp_enqueue_scripts) called at [/***PATH_REDACTED***/wp-includes/script-loader.php:1197]
#5  wp_enqueue_scripts()
#6  call_user_func_array(wp_enqueue_scripts, Array ([0] => )) called at [/***PATH_REDACTED***/wp-includes/plugin.php:524]
#7  do_action(wp_head) called at [/***PATH_REDACTED***/wp-includes/general-template.php:2555]
#8  wp_head() called at [/***PATH_REDACTED***/wp-content/themes/Parallax-One/header.php:19]
#9  require_once(/***PATH_REDACTED***/wp-content/themes/Parallax-One/header.php) called at [/***PATH_REDACTED***/wp-includes/template.php:572]
#10 load_template(/***PATH_REDACTED***/wp-content/themes/Parallax-One/header.php, 1) called at [/***PATH_REDACTED***/wp-includes/template.php:531]
#11 locate_template(Array ([0] => header.php), 1) called at [/***PATH_REDACTED***/wp-includes/general-template.php:45]
#12 get_header() called at [/***PATH_REDACTED***/wp-content/themes/Parallax-One/front-page.php:5]
#13 include(/***PATH_REDACTED***/wp-content/themes/Parallax-One/front-page.php) called at [/***PATH_REDACTED***/wp-includes/template-loader.php:75]
#14 require_once(/***PATH_REDACTED***/wp-includes/template-loader.php) called at [/***PATH_REDACTED***/wp-blog-header.php:19]
#15 require(/***PATH_REDACTED***/wp-blog-header.php) called at [/***PATH_REDACTED***/index.php:17]

Add this following code to the query() function,  just before the return statement withing the the “case ‘queue’ :line in the file wp-includes/class.wp-dependencies.php.  (in the version current as of this writing it is about line 387)

//BEGIN NON WP CODE - MATRAEX
                     foreach($this->queue  as $queued)
                            $check[$queued]=$this->registered[ $queued ]->deps; 
                    foreach($check as $queued => $deparr)
                        foreach($deparr as $depqueued) 
                            if($check[$depqueued] && in_array($queued,$check[$depqueued]))
                                $recursivedependencies[$queued]= $depqueued;
                    if($recursivedependencies)
                    {
                       $_SERVER[DOCUMENT_ROOT] = str_replace("/home","/data",$_SERVER[DOCUMENT_ROOT]);
                       ob_start();
                        echo "

 

MATRAEX Debugging Code

blog post
This WordPress project has circular dependencies
Aborting script execution at “.__FILE__.”:”.__LINE__.”
Debugging tip look for theme code that calls ‘enqueue’ on for items which already have dependencies)
If this error did not show, your script would have likely errored on line 339 when it ran out of memory from the circular debugging.
Most likely this is a plugin error!!


“; global $enqueue_backtrace; foreach($recursivedependencies as $queued =>$depqueued) { echo ”
$queued has a dependency on $depqueued which has a circular dependecy on $queued” ; echo ”
Backtrace of when $queued was enqueued: “; foreach($enqueue_backtrace[$queued] as $k=>$lines) { echo ”
Instance $k:

";
                                foreach(explode("\n",$lines) as $line)
                                    if(strstr($line,'enqueue'))
                                        echo "$line\n";
                                echo "

“;
}
}
$out=ob_get_clean();
$out = str_replace($_SERVER[DOCUMENT_ROOT],”/***PATH_REDACTED***/”,$out);
$out = str_replace(“/plugins/”,”/plugins/”,$out);
$out = str_replace(“/themes/”,”/themes/”,$out);
echo $out;
exit;
}
//END NON WP CODE – MATRAEX

The full function code should look like this

In Addition,  add the following code to the enqueue  function just below the line with public function enqueue ()  at the time of this writing,  that wa about line 378 of wp-includes/class.wp-dependencies.php.

        //BEGIN NON WP CODE - MATRAEX
            global $enqueue_backtrace;
            ob_start();
            debug_print_backtrace(); 
            $enqueue_backtrace[$handles][] = ob_get_clean();
        //END NON WP CODE - MATRAEX

The full function code should look like this

 

Wordfence – CPU issue with exhaustive scans – COMMANDDUMP

Wordfence has some default scans which run hourly.   On many systems this works well.  In at least one case we found a situation where Wordfence was running hourly scans on some VERY large libraries at the same time on multiple sites on the same server.

A fix was implemented for this,  but in the time that it took us to recognize this issue,  we came up with the following command which helped to kill the CPU hog so we could continue to use the WordPress websites.

 

 kill `apachectl fullstatus|grep wordfence_doScan|awk '{print $2}'`

Some of the ways you can find out that the issue is occuring is by running some of these investigative commands

  • apachectl fullstatus|grep wordfence – how many concurrent scans are running
  • mysqladmin  processlist|grep wf – the number of insert / update / select commands against Word Fence tables
  • vmstat 1 – run a monitor on your system to see how active you are
  • uptime – see your 1 , 5 and 10 minute loads

 

COMMANDDUMP – Cloning a WordPress website for a Sandbox, Upgrade or Overhaul

Over the years,  we have had clients ask us to create an exact copy of their current website (files, database and all) in a sandbox environment that would not affect their existing website.    This typically involves setting up a temporary domain and hosting environment,  and a new MySQL database,  however they need them to be populated with an exact copy.

The needs they have varies:

  • often it is to just be able to test a change within a disposable Sandbox,
  • sometimes,  they may want to do some sort of an upgrade,  but they do not have  a dedicated development or test environment,
  • and commonly it is to start some sort of a site overhaul using the existing site’s pages, blog entries and design.   In this case they will often migrate this site to their production site in the future

While a copy and paste seems like the simply way to do this,  there is much more that must occur. This list below describes a list of all of the ones we have found so far

  • Copy all of the files from the OLD WordPress root,  to the NEW WordPress root
  • Copy the entire database from Database A to Database B
  • Update the NEW WordPress install to connect to Database B
  • Update the Database B install wp_options to have the NEW url (if you skip this step,  attempting to login to the NEW WordPress install will redirect you to the OLD WordPress install)
  • Update all posts, pages and other entries which have absolute links to the OLD WordPress install to have absolute links to the NEW WordPress install.  (if you do not change this,  you may end up with embedded images and links which point back to the OLD WordPress install,   sometimes this can be difficult to realize because the file structure is identical)

Once we realized this was going to be a common request and that we often need to do this from one directory on a server to another,  we wanted to automate this process.     We created a quick and dirty script which accomplishes all of the tasks of cloning the database and files,  and then updating the contents of the database to the new location.

If you would like help with this process please contact us, Matraex would be happy to help you clone your WordPress website.
If you need a company to Manage your WordPress security and updates on a monthly basis   please let us know here.

The script relies on some basic commands which should already be installed on your system,  but you may want to confirm first

  • sed
  • mysql
  • mysqldump

The script is one that you will run from the command line when you are within the existing WordPress website.   You will run the command with parameters about the new WordPress website (The new directory,  the new url,  the new MySQL connection information.

The script does a couple of basic checks to make sure that the directory you are cloning to,  does not already have a WordPress installation,  and that the MySQL database is available but does not already have a WordPress install in the ‘default’ location.

It also uses the wp-config.php of the current WordPress installation to get connection information to the existing WP database and get the current URL.

If everything checks out  the script

  • copies all files from the old directory to the new directory
  • dumps the existing database,  manipulates a file to replace the old url with the new url
  • imports the file into the new mysql database.
  • updates the new directory wp-config.php to use the new MySQL connection information

File: wordpress_clone.sh

#!/bin/bash
echo
echo Usage: $0 1-NEW_DIR 2-NEW_URL 3-NEW_DB_HOST 4-NEW_DB_NAME 5-NEW_DB_USER 6-NEW_DB_PASSWORD

if [ "$1" == "" ] || [ "$2" == "" ] || [ "$3" == "" ] || [ "$4" == "" ] || [ "$5" == "" ] || [ "$6" == "" ]; then
  echo
  echo "Invalid Parameters; please review usage";
  echo "Exiting"
  echo
  exit
fi


NEW_DIR=$1
NEW_URL=$2 #type the url address that the new WordPress website is located at
NEW_DB_HOST=$3 #TYPE the name of the database server for the NEW WordPress Install
NEW_DB_NAME=$4 # Type the name of the NEW WordPress Database you want to connect to
NEW_DB_USER=$5 #TYPE the username to connect to the NEW WordPress Database
NEW_DB_PASSWORD=$6 #TYPE the password to connect to the NEW WordPress Database

#this script assumes that you entered perfect information, it does not do any checking to confirm that any of the information you entered is valid before proceeding
ORIG_DIR=`pwd`
OLD_DIR=$ORIG_DIR


#load all of the DB_variables from the old database into memory so we can dump it
if [ ! -e wp-config.php ]; then
  echo
  echo "The current directory is not an existing WordPress installation"
  echo "Exiting"
  echo
  exit
fi


if [ ! -d $NEW_DIR ]; then
  echo
  echo "The new directory $NEW_DIR does not exist"
  echo "Exiting"
  echo
  exit
fi
cd $OLD_DIR
source <(grep "^define('DB" wp-config.php |awk -F"'" '{print $2"=\""$4"\""}')


EXISTING_NEW_DB=` mysql -u $NEW_DB_USER --password=$NEW_DB_PASSWORD -N --execute='select now()' -h $NEW_DB_HOST $NEW_DB_NAME 2>/dev/null`
if [ "" == "$EXISTING_NEW_DB" ]; then
  echo
  echo "New Database Connection Failed; A new blank database must be available in order to continue"
  echo "Exiting"
  echo
  exit
fi
EXISTING_NEW_URL=` mysql -u $NEW_DB_USER --password=$NEW_DB_PASSWORD -N --execute='select option_value from wp_options where option_id=1' -h $NEW_DB_HOST $NEW_DB_NAME 2>/dev/null`
if [ "" != "$EXISTING_NEW_URL" ]; then
  echo
  echo "There is already a WordPress database located at $NEW_DB_NAME: using '$EXISTING_NEW_URL'"
  echo "Exiting"
  echo
  exit
fi
OLD_URL=` mysql -u $DB_USER --password=$DB_PASSWORD -N --execute='select option_value from wp_options where option_id=1' -h $DB_HOST $DB_NAME`
if [ "" == "$OLD_URL" ]; then
  echo
  echo "The database configuration in wp-config.php for the current WP install does not have a valid connection to the database $DB_NAME $DB_USER:$DB_PASSWORD@$DB_HOST"
  echo "Exiting"
  echo
  exit
fi 
echo "from:$OLD_URL" 
echo "to :$NEW_URL"
cp -ar $OLD_DIR/. $NEW_DIR/.

TMPFILE=$(mktemp /tmp/`basename $0`.XXXXXXXXX)
echo "Dumping Database "
mysqldump -h $DB_HOST --extended-insert=FALSE -c -u $DB_USER --password=$DB_PASSWORD $DB_NAME >$TMPFILE
echo Temp DB File:$TMPFILE
sed -e"s|$OLD_URL|$NEW_URL|g" -i $TMPFILE
cat $TMPFILE | mysql -u $NEW_DB_USER --password=$NEW_DB_PASSWORD $NEW_DB_NAME
rm $TMPFILE
cd $ORIG_DIR
cd $NEW_DIR

sed -e"s/define('DB_USER', '[A-Za-Z0-9]*/define('DB_USER', '$NEW_DB_USER/" -i wp-config.php
sed -e"s/define('DB_PASSWORD', '[A-Za-Z0-9]*/define('DB_PASSWORD', '$NEW_DB_PASSWORD/" -i wp-config.php
sed -e"s/define('DB_HOST', '[A-Za-Z0-9\.]*/define('DB_HOST', '$NEW_DB_HOST/" -i wp-config.php
sed -e"s/define('DB_NAME', '[A-Za-Z0-9]*/define('DB_NAME', '$NEW_DB_NAME/" -i wp-config.php
echo "Wrote DB Changes to $NEW_DIR/wp-config.php"

WordPress delay from a plugin – curl delay from plugin

The following is some documentation of how I found an odd random delay which showed up on a WordPress website using a plugin,   this is how I found the issue and how I would more quickly find it next time.

The WordPress Plugin Delay Problem

Every time the WordPress website would load,  it would take about 15 second (actually between 15.2 seconds and 15.9 seconds) to respond.

It was very consistent in the delay and I quickly assumed it is a plugin.

I used two methods of debugging.

TCPDUMP

I ran TCP dump on the server and made sure that the web server received the packet I sent it,  and that the delay was fully on the server

tcpdump host x.x.x.x port 80 -Xvvvvvvvvvvvvvvvvvvv

I found that the delay was on the server,   the packets would be received by the server and the server would not respond until just over 15 seconds.
With this information I could confirm that without a doubt,  the server was causing this 15 second delay.

LSOF

I used the lsof command to find out what open files were on the system when the command was delayed.    I found that there was an outgoing http request to an odd IP address

#lsof -i:80 -n
localip:28876->159.203.88.42:http

From experience with the website I knew that each time the WordPress application was called,  it should not be calling ANY other website.
This did not help me find the problem,  but I recognized that the issue was that some plugin was calling this IP address and it was stuck waiting to receive a result,  which was blocking the page from loading.   By running the lsof command multiple times during a request,  I was able to see that this connection stayed open in the (SYN) mode for about 15 seconds.      When I attempted to ping the IP,  or open port 80 to the IP,  I received no response.

To try to help me figure out what server this was and what plugin was calling this,  I tried to lookup the IP

#dig -x 159.203.88.42
;; QUESTION SECTION:
;42.88.203.159.in-addr.arpa. IN PTR

;; ANSWER SECTION:
42.88.203.159.in-addr.arpa. 1800 IN PTR 45215-36110.cloudwaysapps.com.

;; AUTHORITY SECTION:
203.159.in-addr.arpa. 80642 IN NS ns3.digitalocean.com.
203.159.in-addr.arpa. 80642 IN NS ns2.digitalocean.com.
203.159.in-addr.arpa. 80642 IN NS ns1.digitalocean.com.

With this I could have dug deeper to find out what plugins were hosted on the ip or something,  but it seemed easier to just start disabling plugins until I no longer see the delay.   So that is what I did,  i just disabled one plugin at time (with a 15 second delay between each) until I reached ‘Easy Modal’.  As soon as I disabled the plugin,  the website loaded quickly.

Now,  I could have just ditched the plugin since it clearly uses a method of verification which unacceptably blocks websites from using the plugin if their website is not running,  but I dug deeper with the hopes that I will be able to more quickly figure out problems like this in the future.

I dug into the plugin and found that they have a hardcoded  API url http://easy-modal.com . When I ping this url,   i find that the IP resolves to:

#ping easy-modal.com
159.203.88.42

They luckily did use some WordPress built in functions in order make some calls to it server.

#wp_remote_get

wp_remote_get is a function which receives a url and returns information from the remote server for use in the programming,  it appears they were using it to confirm that licensing was upto date,  which would have been fine if they would have backgrounded the process in their code and then returned some sort of true in the case their server was not running correctly.

While this is not nearly as big of a deal it reminds of  How one developer just broke Node, Babel and thousands of projects in 11 lines of JavaScript.

Now the quicker way to find out where some plugin is blocking based on a url request.

Code to evaluate external URL calls which might be slowing your page

I wrote the following to help me then track down all the locations in your site that are doing remote calls.   It does not identify the url it is calling but it shows a backtrace in your error log which will lead you right to the location in the wp install that is making the call (whether it is a plugin or not)

I was VERY surprised how much network activity was occuring from the website server to other servers on EACH website request.  you can write a plugin that does the following.

Add the following code to a plugin in your WordPress install

 add_filter('http_request_args','log_wp_start_request');
add_filter('http_response','log_wp_end_request');

function log_wp_end_request($args)
{
  global $page_log_tag,$log_request_tag;
  error_log("WPEND $log_request_tag Characters returned: ".strlen(print_r($args,true)));
}
function log_wp_start_request($arg)
{
  global $page_log_tag,$log_request_tag;
  if(!$page_log_tag)
     $page_log_tag=chr(rand(65,80)).chr(rand(65,80));
  $log_request_tag=$page_log_tag."_".chr(rand(65,80)).chr(rand(65,80));
  $bt=debug_backtrace();
  array_shift($bt);
  error_log("WPSTART $log_request_tag $nm $args");
  foreach($bt as $fl)
  {
    $add.=" ";
    $btout="WPBACKT $log_request_tag $add $fl[file]:$fl[line]";
    $btout=str_replace($_SERVER[DOCUMENT_ROOT],"",$btout);
    error_log($btout);
  }
}

 

or you can check-remote plugin zip I created with the code.  There are NO warranties on this.

If you have any debugging you would like done on your WordPress Plugins,  Matraex does custom WordPress plugin development and would be happy to help you troubleshoot.

 

Top 3 Reasons You Need A Managed WordPress Service

Top 3 Reasons You Need A Managed WordPress Service

Managed WordPress Service

Regular monitoring

Any number of problems can arise with a WordPress website. It is important to have a human regularly monitoring your WordPress website. With a Managed WordPress Service, you will have any number of technical staff regularly monitoring your website. Every website on the Internet is vulnerable to a long list of issues from hackers to hardware failure. No system is impermeable and even external events can take a website down such as network router failures.

Freedom to Focus

With a Managed WordPress Service, you don’t have to spend your valuable time dealing with any technical issues. This allows you to do what matters, that is build your content and audience. How can you spend your valuable time on SEO or building new content for your website when you have to deal with technical trouble or malware. An analogy I like to use is that you want to focus on driving your car, not working on the engine.

Expert Support

As a blogger or business person, you should not have to be a technical expert at WordPress. With a Managed WordPress Service, you get a team of experienced WordPress experts that support you when trouble arises.

What sort of trouble should you be concerned with? Malware, hackers, software bugs etc. Many people aren’t aware that almost every WordPress website on the Internet is probed for vulnerabilities and password guessing, all the time. The content or popularity of the site doesn’t matter. Hackers just want to get into your system so they can use to it trick Google and other search engines into helping their money websites.

Having a team of WordPress experts on your side saves a lot of time and money for a low-cost investment.

Matraex Inc., offers an affordable Managed WordPress Service with regular monitoring, hacker/malware defense and removal service, schedule reports, and emergency updates/security patches. Contact us for a free quote!

Website WordPress PHP Custom Application Development Boise

Website WordPress PHP Custom Application Development Boise

I was asked recently, what kinds of work do you do for your clients.Website, WordPress, PHP Custom Application Development Boise

The short answer is “Matraex, Inc provides Website WordPress PHP Custom Application Development Boise to small businesses

Below I describe our services in more depth.

Contact me to discuss what we can do for you – Michael Blood – 208.344.1115 x 250

Matraex, Inc – Nationwide Web Services

  • We design online presence websites in WordPress.
  • We custom build web applications for businesses, entrepreneurs and individuals with ideas.
  • We create custom automation and time saving software using the web.
  • We support, refresh, repair and enhance existing websites and custom applications.
  • We provide Managed WordPress Hosting services.
  • We build, host and support custom scale-able hosting environments.

Matraex, Inc – Basic consulting and technology list

Matraex Inc, – Boise, Idaho Web Services:Website WordPress PHP Custom Application Development Boise

While we work for clients nationwide. A large percentage of our clients are from here in Boise, Idaho. When items become complex we are able to work directly with clients in our office onsite at our client’s office. We communicate via skype or just on the phone.

WordPress Website Developmentwordpress-development

WordPress is an online, open source website creation tool written in PHP.  WordPress allows Matraex, Inc to quickly create a beautiful online presence for your business and the give you the ability to login and make simple updates to your site.  It is the easiest and most powerful blogging and website content management system (or CMS)

We offer WordPress  Website Development solutions that are compatible with all business models and industry verticals. Our team of WordPress developers provides WordPress CMS development, plugin development. Also theme customization and maintenance services as well as ongoing security and update services through our Managed WordPress Hosting.

When you engage Matraex, Inc  to build or enhance your online, unless you have another tool in place. We will likely recommend that we develop your marketing presence using the WordPress Content Management System.  Depending on your vertical and your website needs we will either find existing WordPress plugins. We also build new plugins which add the needed custom touch to your website.

WordPress Plugin Development

A WordPress plugin is a piece of software that can be uploaded to extend and expand the functionality of your WordPress site.  Matraex, Inc builds custom plugins such as this,  any time that our client needs are not met with the base WordPress Package.

In each of these situations,  Matraex, Inc relies on its deep knowledge of WordPress. Also the WordPress SDK and the PHP programming language to implement new and innovative website features.

Legacy WordPress Plugin Repair and Replacement

In many cases we have customers with existing WordPress websites with plugins which are out of date. Even some what wont work with newer versions of WordPress,  in these cases we can:

  • Find an up to date WordPress Plugin which replaces the functionality of the out of date plugin
  • Make changes to the WordPress Plugin code to bring it up to date or
  • Build a replacement plugin made for the current version of WordPress.

Custom Web Application DevelopmentWebsite WordPress PHP Custom Application Development Boise

Matraex, Inc works with entreprenuers, business owners and individuals with ideas to define innovative Web based applications and solutions which solve real world problems.   Our team takes stakeholders through a process to define problems and craft potential solutions.  From this we build a project that  our clients want and the Matraex team can commit to.  We then work closely with the client to get constant feedback throughout the development process to implement a fabulous product.  Each of our Custom Web Application projects are implemented into a production hosting environment,  where we continue to support them as needed.

Web Task Automation

Most people that work within a small business recognize problems and issues within their industry that need to be fixed.   Small tasks which take up more time,  than the value they provide.  They often know that if they had the software,  the task could be automated.   Matraex, Inc builds the custom software that provides this automation.   We work with our clients,  the industry professionals who understand the issues. We create software which reliably accomplishes and automates the tasks.   We periodically followup on the process to confirm that the software continues to accomplishes what has been intended or whether it could be improved.

PHP Developmentphp-development

PHP Powers nearly 70% of websites and has emerged as the most preferred & widely used server-side language.  Historically, 90% of our development projects have been done with PHP. All new development projects are done using PHP, whether it is within the WordPress CMS. The laravel Framework, uses other composer packages. Or a custom frameworkless PHP project using a homegrown library of functions.

Matraex builds PHP websites using MySQL, Linux and Apache which is popularly known as the LAMP platform.   We are able to launch new LAMP shared or dedicated development and production environments in minutes at one of our two redundant Data Centers (Involta and Fiberpipe)

Our company’s PHP Development Services offer multipurpose solutions that encapsulate the following:

  • PHP Web Development
  • PHP Application Development
  • Custom PHP Development
  • PHP Software Customization and Integration
  • PHP Porting and Migration
  • Packaged PHP Applications
  • PHP Professional Services
  • PHP Outsourcing

MySQL and Postgres Database Administrationmysql-database-administration

The custom applications that Matraex, Inc develops integrate with a database to store persistent application data.  Some applications like WordPress automatically setup and  manage all aspects of the MySQL database architecture. But our custom applications require database administration (DBA) services for setup and maintenance.   Matraex, Inc has Oracle Certified MySQL Administration experts to address the Database needs of these custom applications.

Matraex, Inc internally follows very stringent Database Naming conventions which we have used for more than 10 years.  These standards allow our development team to very quickly create custom relationships.  We also area able to easily read and understand relationships in existing applications we have built.

Website Overhaul and Repair

Websites get old,   designs get tired and software gets outdated.  Matraex, Inc breathes new life into websites by either a small simple change. Or a complete website overhaul.  Depending on the client need we address goals and budget to recreate websites which perform.

Matraex offers Website WordPress PHP Custom Application Development Boise.

Remove WordPress Generator Tags: Powered by Visual Composer – drag and drop page builder for WordPress

Remove WordPress Generator Tags: Powered by Visual Composer – drag and drop page builder for WordPress

When using a WordPress theme that uses the ‘Visual Composer’,   a meta tag

  • Powered by Visual Composer – drag and drop page builder for WordPress

Is displayed on the output of each of your pages.

You can  use a tool like our WordPress Website Tool to see what generator meta tags are exposed by your WordPress installation

Since one of our initiatives here at Matraex, Inc while optimizing WordPress websites, is to remove the telltale signs of a WordPress installation,  we need a way that we can easily remove these tags.

We already have a plugin that we install into each of the WordPress websites that we manage which helps us to optimize each of them so we had a quick place we could add custom code to handle the removal.

This gives us a more reliable way to customize the output, without having to worry about the settings within different plugins.

We added the following code which removed the Visual Composer Generator Tag

add_action('init', 'optimize_fixwp_head', 100);
function optimize_fixwp_head() {
   remove_action('wp_head', array(visual_composer(), 'addMetaData')); 
}

Once you have added this,  you can do a very quick check to see that the meta tag has been removed using our WordPress Website Tool .  
The tool will also help you identify whether you have any other common WordPress exposure issues.

 

In researching the way to implement this thanks to :

 

 

WordPress Website Check Instant tool 3 feedback areas

WordPress Website Check Instant tool 3 feedback areas

When working with WordPress websites, there are three main areas we assess within the first few seconds, speed, security and exposure. To help us quickly do this, we built a tool, WordPress Website Check Instant tool 3 feedback areas, which pulls this information quickly and puts it into a single interface.

WordPress Website Check – http://matraex.com/website-check.php

While each of the three areas of speed, security and exposure go much deeper than this small scan, we are able to see some very important metrics very quickly.

Three Checks

Speed

We can see the download speed,  the size of your home page,  the number of external CSS files and the number of external scripts.   This helps us to see how well the site has been optimized.  Typically wordpress websites are made up of a Theme with enabled capabilities,  as well as a number of plugins.  Each of the capabilities and plugins will often have their own stylesheets and script files which can add up to a bloated website.

Security

WordPress websites are the subject of frequent hack attempts.  Website scanners quickly find WordPress sites that have their admin and login scripts exposed.  The scanner identifies the scripts.  If the scripts do not block access after a number of failed attempts (with the username ‘admin’ and then with a random username)  the script fails.

Exposure

WordPress websites often publish their version number as well as details about which plugins it uses.  This information ideally is private and if possible should be kept private.  When vulnerabilities in these tools are found,  this is an advertisement to exploit your site.

The results can be saved and a link will be sent to your email so you can permanently have access to the results

The tool is our way of checking a site within seconds,  and we offer it free.   Our hope is that others find this useful ad will come to Matraex, Inc for their Website Development, Design, Hosting and Security needs.

Matraex, Inc
208.344.1115

 

 

WordPress Website Check Instant tool 3 feedback areas

Preg_Match Visual Composer PHP Error

We started getting a preg_match Visual Composer PHP error that was: Warning: preg_match() expects parameter 2 to be string, array given in /wp-content/themes/bridge/vc_templates/vc_empty_space.php on line 12.

visual-composer-icon

I was able to determine that when using the empty space feature for managing site contents in the design, if you saved “px” in the pixel value for the size of the empty space, WordPress results would throw this error. For example, if I saved 16px for the size, we would get this error message. However, if I went back in and just saved the value as 16 the system would work as expected.

This is only a slight fix, I have discovered that in a recent update to Visual Composer, the issue was resolved. So be sure you have updated to (at this time) v4.8

Here is a quick link to the Visual Composer plugin.

 

 

This webpage is not available ERR_CONTENT_DECODING_FAILED – PHP ob_start() ob_gzhandler – Trailing spaces after closing ?> in WordPress Plugin

This webpage is not available  ERR_CONTENT_DECODING_FAILED – PHP ob_start() ob_gzhandler – Trailing spaces after closing ?> in WordPress Plugin

Recently we ran into an issue where a website would not load.   We traced the problem to a line in the code which attempted to pass all content to ob_start(‘ob_gzhandler’).

This basically words to zip up all content and send it to the browser.  However an error was being thrown ERR_CONTENT_DECODING_FAILED,  which showed up in the browser window and in the browser console.  After some detailed debugging in PHP using some die commands()

die("die: ".__FILE__.":".__LINE__);

I found that the issue came from an rogue blank character which displayed before the ob_start(“ob_gzhandler”) function could be called.

There were a couple of ways I could deal with this,  first I could simply put an ob_start() at the top of the code,  and then put an ob_get_clean(); just before the ob_start(‘ob_gzhandler’),  however this felt a bit sloppy,  so I went in search of the rogue character.

The application that this was in,  was one that simply included the wordpress load file so that it could integrate with a WordPress installation,   and I found that the characters was coming from the WordPress install.   Using a hunch I decided d to look for a recently updated plugin and I quickly found a plugin that had an end php tag “?>” with an extra line after it.

I quickly fixed this and then decided I would figure out a way to quickly identify issues like this.  While there are many ways to address this and figure out how to over come it,   the issue seems to identify an need to figure out whether plugins conform to some best practices (such as omitting a closing ?> php sign)

If we identify this need,  we will write a free plugin to put on the WordPress site,  which will go through all plugins on sites to confirm that they use some best practices such as this.


			
Call Now Button(208) 344-1115

SIGN UP TO
GET OUR 
FREE
 APP BLUEPRINT

Join our email list

and get your free whitepaper