I have just taken over someone's hosted WordPress site. How do I find out what version he is running?
Look in wp-includes/version.php
/**
* The WordPress version string
*
* #global string $wp_version
*/
$wp_version = '2.8.4';
Unless he edited some code to delete this, you should be able to view source on the site and look for this meta tag:
<meta name="generator" content="WordPress 2.7.1" />
That will give you the version.
On the Admin Panel Dashboard, you can find a box called "Right Now". There you can see the version of the WordPress installation. I have seen this result in WordPress 3.2.1. You can also see this in version 3.7.1
UPDATE:
In WP Version 3.8.3
In WP Version 3.9.1 Admin Side, You can see the version by clicking the WP logo which is located at the left-top position.
You can use yoursitename/readme.html
In the WordPress Admin Footer at the Right side, you will see the version info(Version 3.9.1).
You can get the WordPress version using the following code:
<?php bloginfo('version'); ?>
The below file is having all version details
wp-includes/version.php
Update for WP 4.1.5
In WP 4.1.5, If it was the latest WP version in the footer right part, it will show the version as it is. If not, it will show the latest WP version with the link to update.
Check the below screenshot.
For any wordpress site, you can go to http://example.com/feed and check the following tag in the xml file to see the version number:
<generator>http://wordpress.org/?v=3.7</generator>
Here, 3.7 is the version installed.
If you came here to find out about how to check WordPress version programmatically, then you can do it with the following code.
// Get the WP Version global.
global $wp_version;
// Now use $wp_version which will return a string value.
echo '<pre>' . var_dump( $wp_version ) . '</pre>';
// Output: string '4.6.1' (length=5)
Cheers!
Every WP install has a readme.html file.
So just type www.yourdomain.com/readme.html
The easiest way would be to use the readme.html file that comes with every WordPress installation (unless you deleted it).
http://example.com/readme.html
Note: it looks like the readme.html file no longer outputs the current WordPress version. So, there is no way, for now, to see the current WordPress version without logging into the dashboard.
On the Admin panel in the footer you should see the words "Wordpress x.x" where x.x is your version number :)
Alternatively you can echo out the WP_VERSION constant in your script, it's up to you. The former is a lot quicker and easier.
From Dashboard At a Glance box
or at the bottom right corner of any admin page.
If that Glance box is hidden - click on screen options at top-right corner and check At a Glance option.
Because I can not comment to #Michelle 's answer, I post my trick here.
Instead of checking the version on meta tag that usually is removed by a customized theme.
Check the rss feed by append /feed to almost any link from that site, then search for some keywords (wordpress, generator), you will have a better chance.
<lastBuildDate>Fri, 29 May 2015 10:08:40 +0000</lastBuildDate>
<sy:updatePeriod>hourly</sy:updatePeriod>
<sy:updateFrequency>1</sy:updateFrequency>
<generator>http://wordpress.org/?v=4.2.2</generator>
Just go to follow link
domain.com/wp-admin/about.php
Open the blog, Check source once the blog is open. It should have a meta tag like:
<meta name="generator" content="WordPress 2.8.4" />
Yet another way to find the WordPress version is using WP-CLI: Command line interface for WordPress:
wp core version
From experience with WordPress 3.8.3:
(1) Login as admin
(2) Click on the W menu in the upper left corner
(3) Click on menu item "About WordPress".
This will take you to .../wp-admin/about.php
There it will say "Welcome to WordPress 3.8.3"
I know I'm super late regarding this topic but there's this easy to use library where you can easily get the version numbers of Worpress, PHP, Apache, and MySQL, all-in-one.
It is called the Wordpress Environment (W18T) library
<?php
include_once 'W18T.class.php';
$environment = new W18T();
echo $environment;
?>
Output
{
"platform": {
"name": "WordPress",
"version": "4.9.1"
},
"interpreter": {
"name": "PHP",
"version": "7.2.0"
},
"web_server": {
"name": "Apache",
"version": "2.4.16"
},
"database_server": {
"name": "MySQL",
"version": "5.7.20"
},
"operating_system": {
"name": "Darwin",
"version": "17.0.0"
}
}
I hope it helps.
In dashboard you can see running word press version at "At a Glance"
Related
I want to unzip more than 2 folders in plugin folder by word press functions, and i got succeed to do that and with extraction of the plugin i wanted to activate that so i used activate_plugin() function, but getting The plugin does not have a valid header error.
Probably in your header, there are some characters like $ : % / & or , like:
<?php
/*
Plugin Name: Simple:Press & % $
*/
?>
Try to remove that, and then activate again. Also, try by installing both plugins manually. You might be able to find one which is causing this issue.
This sounds like it should be something simple or there should be a simple shortcode plug in to achieve this but i have searched and searched for almost and hour now and can't find the answer. All i am trying to do is display the post's published date in the body text. Example: [meta = "Date"]. Is there an easy light weight solution to achieve this. I simply need to publish the post date inside the content. Thanks.
There is a good article on how to do this with a custom plugin or snippet of code for your theme
https://krogsgard.com/2012/create-a-shortcode-to-show-when-a-post-was-last-updated/
You can create a shortcode easily within WordPress. This is a sample of code that you can either place in a new plugin file. For creating a plugin file, visit https://codex.wordpress.org/Writing_a_Plugin , basically, you create a file, lets say my_shortcodes.php and place it in the /wp-content/plugins/ folder. In that file, you would have the following.
<?php
/*
Plugin Name: My Plugin Stuff
Plugin URI: http://domain.com/
Description: My Plugin Stuff
Version: 0.1.0
Author: Your Name
Author URI: http://your-website.com/
License: GPLv2 or later
*/
function shortcode_post_published_date(){
return get_the_date();
}
add_shortcode( 'post_published', 'shortcode_post_published_date' );
Then you would use the shortcode in your post [post_published]
Disclaimer:
This is a sample of what it may look like. You may have to make some modifications to it to make it work the way you want. You may not be able to copy and paste this into your code and it work right away.
I am developing a WordPress theme, i have downloaded and installed the "contact form 7" plugin. Now when i send this theme to my client and they install/activate the theme, i would like the "contact form 7" plugin to be included.
I haven't got access to their wp-admin and i can't expect them to manually install the plugins. So to make it easier for them, i'd like to package the plugins with the theme. Then they install and everything works correctly.
How do i do this or is there a better way e.g. recommend installing a plugin?
You will want to use some variant of the following:
function my_activate_theme() {
$plugins = array(
"plugin_name_1",
"plugin_name_2",
"etc..."
);
foreach ($plugins as $plugin) {
$path = '/path/to/wordpress/wp-content/plugins/{$plugin}.php';
activate_plugin($path);
}
}
add_action('switch_theme', 'my_activate_themes');
You will have to fiddle around with my code, as I don't have access to a wordpress install at the moment to test on, but basically the idea is that you throw this into your functions.php file. It registers the hook for switching theme and on theme switch, loops through the specified plugins and activates them.
I hope this helps, if not, please give me more information and I will attempt to provide further guidance. Good luck!
If you are currently developing theme, you'd rather use tgm activation code than including plugins into your theme.
Please review this Wordpress Theme.
This theme use tgm activation code to install "Visual Composer","Layerslider","Revslider","Quickshop" plugins.
It's much easier to customize and has lots of features. Also easy to learn code tips.
Regards. HanaTheme.
I want to make a plugin for all of my own wordpress-based websites.
The idea is simple, I want to get the version (and probably another info) of those sites by using CURL.
Right now, I have such a code:
<?php
/*
Plugin Name: Manage Site
Plugin URI: http://not-available-yet.com/
Description: A manage site plugin
Author: Go Frendi Gunawan
Version: 0.0
Author URI: http://not-available-yet.com/
*/
// this file is located on wp-content/plugins/manage_site
require_once '../../../wp-includes/version.php'; // do I need to include everything manually like this?
if(isset($_GET['key']))
{
$key = $_GET['key'];
if($key=='1234'){
echo $wp_version;
}
}
And I can access it by using CURL with this address:
http://my_domain.com/wordpress/wp-content/plugins/manage_site/manage_site.php?key=1234
And I'll get the wordpress version as a response:
3.5.1
It is work for now.
But, since this is my first time writing a wordpress plugin, I might do things wrongly. So, Am I doing it right? Or is there any better way to write this?
I've found the answer.
Both, #kjetilh and #brasofilo was right in case of accessing wordpress plugin "the normal way".
Since I access the plugin directly, the wordpress bootstrap is not loaded. Therefore, my first approach was partially right.
But load the wp-load.php is more elegant (and simple and usable) since it load everything, not only the version, and it gonna be useful to access 'more information':
<?php
/*
Plugin Name: Manage Site
Plugin URI: http://not-available-yet.com/
Description: A manage site plugin
Author: Go Frendi Gunawan
Version: 0.0
Author URI: http://not-available-yet.com/
*/
// this file is located on wp-content/plugins/manage_site
require_once '../../../wp-load.php';
if(isset($_GET['key']))
{
$key = $_GET['key'];
if($key=='1234'){
echo $wp_version;
}
}
I'm following this tutorial on how to add a custom button to TinyMCE editor in WordPress. Trying to edit author's JS to include my functionality, yet it seems to have gotten cached. Article author has a hack for it (code snippet below), and it did work for the first time (the button is in the toolbar now), although it doesn't work for subsequent refreshes.
// "This will intercept the version check and increment the current version number by 3.
// It's the quick and dirty way to do it without messing with the settings directly..."
function my_refresh_mce($ver) {
$ver += 3;
return $ver;
}
add_filter( 'tiny_mce_version', 'my_refresh_mce');
What can I do to disable this caching?
Latest fresh WordPress localhost install, no plugins activated.
Turns out the 'no plugins activated' was not enough. Once I did a completely fresh install (without W3 Total Cache plugin), the issue disappeared.