Wordpress Plugin Keeps using the old version of a .php file - php

This is my first try creating a WordPress plugin to do an import of data from a mysql database. PHP isn't my strongest suit either, but I created this plug in and went to enable it and it complained about an error on line 123 (literally). Sure enough there was, I forgot the $ on a property of a class. Fine, I fixed it, and then delete the plugin because it didn't start, install the new one, now my menu item showed up, cool, so now I clicked on it which should bring up a page with a couple buttons. But instead got an message about an error, not much details. So I enabled debugging and it was the same file and same line number. Ah, I for got the this-> part so now I fix it to read $this->sqlconn->close();. Again, deactivate, delete, install the plugin, confirm new files are in the wp-content folder, yet every time tells me line 123 has a syntax error, unexpected '->' (T_OBJECT_OPERATOR).
So now I know it must be using a cached copy somehow, to prove it I put a comment on line 123, went through reinstalling it, and sure enough same error on line 123. Tried updating the version number on the plugin, nope, same old error even though the correct new version shows in the plugins section.
Next I got the wp-cli and ran the command wp cache flush and that same message shows up on the command line. I guess what I really want to do is purge the cache somehow. I see a wp cache delete <key> [<group>] is available but I have no clue what any key or group would be.
So I'm stuck, how can I get it to see the new file. There must be something cached somewhere. I checked wp-super-cache and that is off/disabled.
Any WordPress plugin developers have some tips and solutions?
Thanks!!

Related

Wordpress - PHP Fatal error: Interface 'Requests_Hooker' not found?

i am not able to access my wordpress frontend. After uploading the 'understrap' theme my backend and frontend throw an http 500 exception.
In order to debug the issue, i've set 'WP_DEBUG' to 'true' and receive the following exception:
PHP Fatal error: Interface 'Requests_Hooker' not found in /var/www/html/wp-includes/Requests/Hooks.php on line 15
Next, i've overwrite the complete "wp-includes" folder with an initial "wp-includes" from a new wordpess and now am able to access my backend again. Unfortunately, my frontend is still empty and in wp-content/debug.log is still the same exception.
Plugins, Themes and Uploads are not affecting the issue - that is sure (the first thing i did is to remove the uploaded theme - understrap).
Wp-uploads folder has been completely initialized.
Does anyone had this issue before and might know how to fix it? Any advice is highly appreciated.
I know this is an old request, but in case others have this issue, I found a solution today. It looks like someone deleted or renamed "Hooker.php" in "webroot/wp-includes/Requests". If you are able, I would recommend restoring a previous version of that file using whatever kind of control panel you are using to administrate your site.

ERROR: The file 'wp-config.php' already exists

I clicked on the 'Update WordPress' link in the admin dashboard of my WordPress site, and I am getting this error:
"The file 'wp-config.php' already exists. If you need to reset any of the
configuration items in this file, please delete it first. You may try installing now."
When I try to click the "installing now" link, it seems that WordPress is installing fresh. I want to keep all of the content of my WordPress installation.
I have tried to change the name of the wp-config.php file but that didn't do anything.
Is just a browser cache.
On first URL load, you are redirected from domain.ext to domain.ext/wp-admin/setup-config.php
If you are on Chrome, just open the developers console, go to "Network" tab. Reload the page and right click anywhere in the console, and hit "Clear browser cache".
Now refresh again and you will see your website
I ran into this same issue while I was transferring a site. The issue ended up being with the .htaccess file. I fixed it by resetting my permalinks. There may be other causes to this issue but this worked for me:
Click on General => Permalinks
Click Save Changes (to reset permalinks)
Try to display the website first on the incognito tab. If it works correctly, clear the browser cache.
Once the page refresh has been completed, the website will appear.
You can use the following shortcuts to clear the browser cache.
Windows: Ctrl + F5
Mac OS: CMD + Shift + R
This usually happens when you use an old version of Wordpress files or old database, and you use partly new files of Wordpress.
All you need to do is to delete all WP files and install a fresh Wordpress (new files unzipped from a new version of Wordpress) and use an empty database.
If you're planning to migrate or move from another website, you should use the export/import function built in wordpress.
he file wp-config.php already exists. If you need to reset any of the configuration items in this file, please delete it first. You may try installing now.
Answer:- Please Clear Your browser's cache.
Did I miss the party?
Today I have a problem like what you experienced 5 years ago. The solution is: Remove all caching plugins (Cloudflare, Jetpack, Litespeed).
Maybe you could try to delete 'wp-config.php' file, or take a backup of this file in different folder and then try again.
If you are using bluehost and did not do the one click install :
I solved this problem by deleting the default error pages 404.php 500.php etc...
I do not know why exactly this was causing this issue... Sorry for the sloppy answer but tried clearing cache and recreating the .htaccess file it didn't work.
I removed the added spaces that the Wordpress's own web 'easy installer' created in the wp-config.php file to help me out.
Guess the Wordpress's own wp-config.php ?checker? isn't compatible with Wordpress's own installer. Wow.
Once the added spaces were removed, site comes up fine. I simply modeled the spacing that is in the wp-config-sample.php file.
Because you just installed wp.
Just hit ctrl+F5 done!!!
More likely it is cache issue and this error comes when we try to install one Wordpress inside of another sub folder of the cpanel in the same Wordpress installation and it will be mostly resolved when you try to check it in the private window or another browser
For me it was file permission set to 666 changing it to 664 worked.
If someone is still for a solution.
This happened to me on an existing site while trying to update.
the problem was following line in wp-config.php near the end.
/** Sets up WordPress vars and included files. */
require_once(ABSPATH . 'wp-admin/setup-config.php');
Removing this fixed the problem.
Hope this helps.
RESOLVED: I had the same problem. post hack situation on other account, shared hosting and server NUKED. Luckily I had the backup files from one of the WP plugins but the main page didnt load, I could only go to 404 and from there to other pages but not main page, the error was wp-config eists...install...blah blah blah.....so I tried everything, multiple re-installs, changed the wp_prefix as per previous install on the fresh install and nothing helped, even ordered paid support from the backup plugin developer as I was sure that it fooked because I had Opencart also installed there but the backup was intended for WP only, my web developer also did something, perhaps removed the OC bits from DB, but thank god i managed to resolve it on my own(and justhost),. so I contacted the justhost for the SECOND TIME and they told me that the account is on VARNISH i.e. some sort of automated cache limit, so I told them to take it off and they wanted to know what have I done to reduce the LOAD to the server, so I told this and that and two seconds later everything loaded perfectly. took me about 20 hours to get main page loading, plus probably it will take 10 hours for fine tuning of the site. anyway if you contact jour host make sure you ask them if they are not blocking cahce as the first time I got in contact they couldnt help me.
I also meet with same error and Mr Pierre R is right its just a cache. Just clear your cache or check in private window. All fine.
if someone have still this error..
goto->admin->setup.php (delete this file error will be solve)
hope this will help.

Calendar loading or javascript error

I got a calendar that load fine here : http://studioteknik.info/testinfo/salle-1/ and I got the real site (a copy) where the calendar dont work (or dont load) : http://stada.ca/salle-1/
The problem is firebug, google webdev tool, html validator, removing all plugin, installing removing, changind theme.. i have DONE all that many times...
now i dont have any more tools/idea how to find the bug and what is the problem...
can anyone have and idea whay the calendar is loading fine on first (test) site and NOT loading on the REAL wordking site ....
if it's a jquery error... i have remove all jquery and add only one... it does not help !..
i am LOST !
If I look in the chrome devtools console I get the following error:
Uncaught SyntaxError: Unexpected token <
If I then check where that error is coming from, it seems a json.Parse is failing. Why? I pasted the data the page recieves down below
"{"2013-11-26":{"available":"1","bind":"0","hours":{"00:00":{"available":"","bind":"0","info":"","notes":"","price":"","promo":"","status":"none"}},"hours_definitions":[{"value":"00:00"}],"info":"","notes":"","price":"100","promo":"","status":"available"},"2013-11-27":{"available":"1","bind":"0","hours":{"00:00":{"available":"","bind":"0","info":"","notes":"","price":"","promo":"","status":"none"}},"hours_definitions":[{"value":"00:00"}],"info":"","notes":"","price":"100","promo":"","status":"available"},"2013-11-28":{"available":"1","bind":"0","hours":{"00:00":{"available":"","bind":"0","info":"","notes":"","price":"","promo":"","status":"none"}},"hours_definitions":[{"value":"00:00"}],"info":"","notes":"","price":"100","promo":"","status":"available"},"2013-11-29":{"available":"1","bind":"0","hours":{"00:00":{"available":"","bind":"0","info":"","notes":"","price":"","promo":"","status":"none"}},"hours_definitions":[{"value":"00:00"}],"info":"","notes":"","price":"100","promo":"","status":"available"},"2013-11-30":{"available":"1","bind":"0","hours":{"00:00":{"available":"","bind":"0","info":"","notes":"","price":"","promo":"","status":"none"}},"hours_definitions":[{"value":"00:00"}],"info":"","notes":"","price":"100","promo":"","status":"available"},"2013-12-11":{"available":"1","bind":"0","hours":{"00:00":{"available":"","bind":"0","info":"","notes":"","price":"","promo":"","status":"none"}},"hours_definitions":[{"value":"00:00"}],"info":"","notes":"","price":"50","promo":"","status":"available"},"2013-12-12":{"available":"1","bind":"0","hours":{"00:00":{"available":"","bind":"0","info":"","notes":"","price":"","promo":"","status":"none"}},"hours_definitions":[{"value":"00:00"}],"info":"","notes":"","price":"50","promo":"","status":"available"},"2013-12-13":{"available":"1","bind":"0","hours":{"00:00":{"available":"","bind":"0","info":"","notes":"","price":"","promo":"","status":"none"}},"hours_definitions":[{"value":"00:00"}],"info":"","notes":"","price":"50","promo":"","status":"available"},"2013-12-14":{"available":"1","bind":"0","hours":{"00:00":{"available":"","bind":"0","info":"","notes":"","price":"","promo":"","status":"none"}},"hours_definitions":[{"value":"00:00"}],"info":"","notes":"","price":"50","promo":"","status":"available"},"2013-12-15":{"available":"1","bind":"0","hours":{"00:00":{"available":"","bind":"0","info":"","notes":"","price":"","promo":"","status":"none"}},"hours_definitions":[{"value":"00:00"}],"info":"","notes":"","price":"50","promo":"","status":"available"},"2013-12-16":{"available":"1","bind":"0","hours":{"00:00":{"available":"","bind":"0","info":"","notes":"","price":"","promo":"","status":"none"}},"hours_definitions":[{"value":"00:00"}],"info":"","notes":"","price":"50","promo":"","status":"available"},"2013-12-17":{"available":"1","bind":"0","hours":{"00:00":{"available":"","bind":"0","info":"","notes":"","price":"","promo":"","status":"none"}},"hours_definitions":[{"value":"00:00"}],"info":"","notes":"","price":"50","promo":"","status":"available"},"2013-12-18":{"available":"1","bind":"0","hours":{"00:00":{"available":"","bind":"0","info":"","notes":"","price":"","promo":"","status":"none"}},"hours_definitions":[{"value":"00:00"}],"info":"","notes":"","price":"50","promo":"","status":"available"},"2013-12-19":{"available":"1","bind":"0","hours":{"00:00":{"available":"","bind":"0","info":"","notes":"","price":"","promo":"","status":"none"}},"hours_definitions":[{"value":"00:00"}],"info":"","notes":"","price":"50","promo":"","status":"available"},"2013-12-20":{"available":"1","bind":"0","hours":{"00:00":{"available":"","bind":"0","info":"","notes":"","price":"","promo":"","status":"none"}},"hours_definitions":[{"value":"00:00"}],"info":"","notes":"","price":"50","promo":"","status":"available"},"2013-12-21":{"available":"1","bind":"0","hours":{"00:00":{"available":"","bind":"0","info":"","notes":"","price":"","promo":"","status":"none"}},"hours_definitions":[{"value":"00:00"}],"info":"","notes":"","price":"50","promo":"","status":"available"},"2013-12-22":{"available":"1","bind":"0","hours":{"00:00":{"available":"","bind":"0","info":"","notes":"","price":"","promo":"","status":"none"}},"hours_definitions":[{"value":"00:00"}],"info":"","notes":"","price":"50","promo":"","status":"available"},"2013-12-23":{"available":"1","bind":"0","hours":{"00:00":{"available":"","bind":"0","info":"","notes":"","price":"","promo":"","status":"none"}},"hours_definitions":[{"value":"00:00"}],"info":"","notes":"","price":"50","promo":"","status":"available"},"2013-12-24":{"available":"1","bind":"0","hours":{"00:00":{"available":"","bind":"0","info":"","notes":"","price":"","promo":"","status":"none"}},"hours_definitions":[{"value":"00:00"}],"info":"","notes":"","price":"50","promo":"","status":"available"},"2013-12-25":{"available":"1","bind":"0","hours":{"00:00":{"available":"","bind":"0","info":"","notes":"","price":"","promo":"","status":"none"}},"hours_definitions":[{"value":"00:00"}],"info":"","notes":"","price":"50","promo":"","status":"available"}}<!-- WP Super Cache is installed but broken. The constant WPCACHEHOME must be set in the file wp-config.php and point at the WP Super Cache plugin directory. -->"
If you scroll to the end you'll see:
<!-- WP Super Cache is installed but broken. The constant WPCACHEHOME must be set in the file wp-config.php and point at the WP Super Cache plugin directory. -->
So, there's something wrong with your wordpress installation and not the webpage.

issue with wordpress Fatal error: Cannot redeclare frm_dl

I got this issue with my website using wordpress
I don't know what's the issue, could someone help us out please.
Fatal error: Cannot redeclare frm_dl() (
You seem to have duplicate function definitions of the function rm_dl() in wp-settings.php. Please review that file so there is only one definition.
It is also not a good idea to post links to your website and ask "please have a look". Much better and easier for us to help if you post the specific error together with the affected files (without passwords of course!).
If there is nothing wrong with your file the error is most likely caused by some newly installed or updated theme or plugin. In worst case it's some automated hack. In both cases you should reverse to a working backup and make sure you update carefully any plugins and base installations with security updates.
This issue is by cause of virus. It is one type of script when this run this create code in each php file like followuing.
.
the solution is that download your live project file and remove this code and upload again all file on live.
you can replace all that code one time replace all with blank cursor only.
Shiv

Broke PHP and caused Wordpress white-screen on Admin

I was doing some work on a wordpress site and another programmer had also been working on it. I was doing the design work, he was doing some custom PHP scripts. (we don't know each other.)
Some of his code was inserted in the wrong place and I made a few changes that I was confident I could undo if they broke the site. 5 hours later I go to log in and all admin screens are blank white. The site is still up and running though.
I tried to switch out the files I altered via ftp, but I must be forgetting something because it is still not working.
I checked the error log on the server and found one fatal error:
[01-Mar-2012 11:25:34] PHP Fatal error: require_once() [<a href='function.require'>function.require</a>]: Failed opening required '/home5/bestbik1/public_html/silvertoday/wp-content/themes/genesis/lib/init.php' (include_path='.:/usr/lib64/php:/usr/lib/php:/usr/share/pear') in /home5/bestbik1/public_html/silvertoday/wp-content/themes/streamline/functions.php on line 3
I am not experienced enough at PHP to know how to proceed to get the admin back up and working.
What does each part of this error mean specifically?
and
What steps do I take to correct or troubleshoot?
UPDATE
Finally gave in and did a fresh install of the most recent version of the Genesis theme framework. Everything works again. Wanted to find the bug, but sometimes you gotta move on. Thanks everybody!
It looks to me like you're using a child theme of the Genesis theme framework. Certainly, you've got a functions.php file in your "streamline" theme that's trying to include Genesis's init.php, which is normally the first line of any Genesis child theme's functions.php.
Assuming that your theme is a Genesis child theme, it looks like your Genesis theme install has become corrupt, with its lib/init.php missing or having the wrong permissions. I'd try removing the Genesis theme and reinstalling it (which may mean deleting and re-uploading the wp-content/themes/genesis folder.)
(You didn't uninstall the Genesis theme, did you? If you're using a Genesis child, Genesis has to be installed even if it's not the "active" theme.)
The error means that a required file :
/home5/bestbik1/public_html/silvertoday/wp-content/themes/genesis/lib/init.php
Could be not opened - there could be a number of reasons
The file is not present
The webserver does not have the correct permissions to read the file
I would first check that the file is present on the server in question.
Using the require_once() or require function in PHP means that is a required file cannot be opened the script is halted - this is the reason for the white screen.

Categories