I have a plugin on my site that uses plugins_url to grab the correct path for an attached javascript file. However, when I load it on my site, it seems to be mixing up the path.
My wordpress installation is at http://serverip/~account/
and the plugin is trying to access the javascript file at http://serverip/~account/~account/yaddayadda (notice the duplication of the ~account dir)
Not really sure where the issue is, and how to resolve it. Any ideas where to start?
You may use WP_PLUGIN_URL to get plugin directory URL and WP_PLUGIN_DIR for directory path, BTW, what issue are you facing with plugins_url?
Related
In my wordpress website .htaccess has some strange redirection script, i removed the file but once the site is browsed the .htaccess file is automatically created with the strange script. in addition to that a folder named generall is also automatically creating even though we delete the folder. The folder has one php file and html file with strange scripts. Please help to resolve the hacking issue
You need to completely remove the infection from your site. Here's the easiest WordPress guide to follow: https://malcure.com/blog/security/the-easiest-guide-to-wordpress-malware-removal/
Your website still contains malware. You need to do a complete virus scan. You can use WordFence plugin to scan.
With these also try
1. Update all theme & plugins.
2. Do a manual update of your WordPress.
I'm having a weird redirection issue and can't figure out how to solve it. I installed my Wordpress in a directory (called /Cafe/ ) for my KatsCafe.org website and all the posts are being redirected just fine. But a huge number of my images are messed up. They won't redirect without the /Cafe/ in the URL, while none of my older URLs for images included a directory. My site is graphic/image heavy and many of them show up in Google Image searches so I am losing a lot of traffic over this.
I can't figure out how to redirect from two separate file paths to the current one.
My oldest file path was from when I installed Wordpress in the root directory with a previous host, so image from that installation would have the file path:
Http://katscafe.org/wp-content/uploads/year/month/name-of-file
to the current image file path, which would be:
Http://katscafe.org/Cafe/wp-content/uploads/year/month/name-of-file
I have another less important redirection I am having a few errors from as well, stemming from the short while I tried out a multisite option (silly me, I thought I would enjoy not having to handle updates, etc ... but I'm entirely too OCD to enjoy that, LOL). Since that meant that my files were in a multi-site directory listing, the file path would have been:
Http://katscafe.org/files/year/month/name-of-file
and still needs to forward to the current image file path, which again, is:
Http://katscafe.org/Cafe/wp-content/uploads/year/month/name-of-file
I'm not sure if I am overlooking an obvious tool that can help me figure this out, but every tool I've found involves post redirection, not a file path type of redirection. And even then I'm not entirely sure of my ability to figure it out completely.
I would be forever grateful for any help with this! Thanks so much!
I'm running the latest version of WordPress (3.5.1), hostet with Strato and since yesterday some of my plugins are not getting the correct path to their files.
UPDATE: It's not a Multisite!
All files are still on the server and haven't been changed or updated since friday (at this point the site was live without issues). The problem is that the plugins are looking at some kind of internal path which looks something like this: website/wp-content/plugins/xxx/xxx/xx/xx/123456789/htdocs/website/wp-content/plugins/akismet/akismet.css so all I get is an error 404 (Not Found)
I cannot locate the problem and I'm not getting any PHP errors or anything like that; only the paths are broken... the plugins are even working, but without images, css and scripts!
Therefore I've deactivated all of the plugins but as soon as I activate them again, I'm running into the same problem.
And finally I've already contacted the provider, but they cannot help at all because it seems to be a problem within WordPress.
UPDATE: I've completely removed all of the plugins, but even if I now download and activate a new plugin the path is broken as mentioned above...
UPDATE2: The wrong path looks like this:
domain.com/wp-content/plugins/mnt/web1/a1/12/123456789/htdocs/
/website/wp-content/plugins/akismet/akismet.css
instead of domain.com/wp-content/plugins/akismet/akismet.css
(actually the second version of the path is working, but all of the plugins are calling the first version, even if completely new installed)
UPDATE3: Sorry, I'm not able to go more into detail, because I've no clue what's going wrong, so I'm giving it a try from another perspective: everything is working fine, with the exception of the plugins. The plugins are even displayed in the frontend, but without any CSS, JavaScript or images. The same thing happens in the backend. I can see all of the plugins and manage (install, edit, configure,...) them, but there is no styling. Everything in case of the design seems to call a wrong path. In doing so the first part of the path is okay, and also the last part, but in the middle there are numbers which should normally not be displayed within a frontend path because they are a part of the Strato server root directory.
It seems your the WP_CONTENT_URL is not correct.
This is defined as in ./wp-includes/default-constants.php:
define( 'WP_CONTENT_URL', get_option('siteurl') . '/wp-content');
So check your settings > general > WordPress Address (URL)
You can also try to define the correct WP_CONTENT_URL in your wp-config.php:
define( 'WP_CONTENT_URL', 'http://www.yourdomain.com/wp-content');
When the above don't help check your .htaccess. Maybe wp-content/ is rewrite to the fullpath.
Sorry for asking this type of stupid ques.
But i don't know I need your help
I look out the coding that they are in wordpress plugin.
require_once('../../../wp-load.php');
I really don't know what the ../../.. is perform some one know ,let me give an suggestion
I am not tell about the core file and all .that extension before the php file.
Thanks.
That loads the WordPress framework for use outside of the native environment.
For example, if you wanted to have a PHP controller that handled AJAX requests, you could load the WordPress environment to validate the current WordPress user login status.
The "../../.." tells the require function to start at the current file, go up three directories, then access wp-load.php.
Based on that path, I can guess that the file is sitting in a theme folder. wp-content/themes/yourtheme
I came across this problem when I was creating a plugin. I cannot call(access ) wordpress default functions like wp_get_current_user(), $wpdb->get_results(), admin_url() etc. from my plugin files. I can access them from my main file of that plugin in which plugin description is given. But I cannot access them from other plugin files. At that time I heard that if we create a new file functions.php and put these code in that file inside a function I can access all wordpress functions. I did so. But now I cannot access that new function. How can I solve this problem? I think you guys understood what I said. Please help me.
#Jan : I got the required thing. I just put require_once('../../../wp-load.php'); in my plugin files and now can access all wp functions from there. Any ways thanks for your reply.