Version Description
- Added recommendation to upgrade in wp-admin/plugins.php
- Provided option to never see the upgrade notice again
Download this release
Release Info
Developer | glen_scott |
Plugin | User Photo |
Version | 0.9.10 |
Comparing to | |
See all releases |
Code changes from version 0.9.9 to 0.9.10
- class-user-photo-upgrade-notice.php +93 -0
- readme.txt +5 -1
- user-photo.php +4 -1
class-user-photo-upgrade-notice.php
ADDED
@@ -0,0 +1,93 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
4 |
+
die( "What you doin' in here?" );
|
5 |
+
}
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Adds a recommendation to upgrade to other plugins.
|
9 |
+
*
|
10 |
+
* @copyright Copyright (c), Ryan Hellyer
|
11 |
+
* @author Ryan Hellyer <ryanhellyer@gmail.com>
|
12 |
+
*/
|
13 |
+
class User_Photo_Upgrade_Notice {
|
14 |
+
|
15 |
+
/**
|
16 |
+
* Set constants.
|
17 |
+
*/
|
18 |
+
const NO_BUG_OPTION = 'user-photo-no-bug';
|
19 |
+
|
20 |
+
/**
|
21 |
+
* Fire the constructor up :)
|
22 |
+
*/
|
23 |
+
public function __construct() {
|
24 |
+
add_action( 'admin_init', array( $this, 'add_notice' ), 5 );
|
25 |
+
add_action( 'admin_init', array( $this, 'set_no_bug' ), 5 );
|
26 |
+
}
|
27 |
+
|
28 |
+
/**
|
29 |
+
* Add admin notice if user hasn't requested not to see it yet.
|
30 |
+
*/
|
31 |
+
public function add_notice() {
|
32 |
+
|
33 |
+
if ( true != get_site_option( self::NO_BUG_OPTION ) ) {
|
34 |
+
add_action( 'admin_notices', array( $this, 'display_admin_notice' ) );
|
35 |
+
}
|
36 |
+
|
37 |
+
}
|
38 |
+
|
39 |
+
/**
|
40 |
+
* Display Admin Notice, asking for a review.
|
41 |
+
*/
|
42 |
+
public function display_admin_notice() {
|
43 |
+
|
44 |
+
$screen = get_current_screen();
|
45 |
+
if ( isset( $screen->base ) && 'plugins' == $screen->base ) {
|
46 |
+
|
47 |
+
$no_bug_url = wp_nonce_url( admin_url( '?' . self::NO_BUG_OPTION . '=true' ), 'user-photo-nonce' );
|
48 |
+
|
49 |
+
echo '
|
50 |
+
<div class="updated">
|
51 |
+
|
52 |
+
<p>
|
53 |
+
The User Photo plugin is out of date and no longer maintained. We recommend switching to the
|
54 |
+
<a href="https://wordpress.org/plugins/metronet-profile-picture/">User Profile Picture</a> plugin
|
55 |
+
by <a href="https://ronalfy.com/">Ronalfy</a>.
|
56 |
+
</p>
|
57 |
+
<p>
|
58 |
+
<strong><a href="' . esc_url( $no_bug_url ) . '">' . __( "Don't show me this message again.", 'user-photo' ) . '</a></strong>
|
59 |
+
</p>
|
60 |
+
</div>';
|
61 |
+
|
62 |
+
}
|
63 |
+
|
64 |
+
}
|
65 |
+
|
66 |
+
/**
|
67 |
+
* Set the plugin to no longer bug users if user asks not to be.
|
68 |
+
*/
|
69 |
+
public function set_no_bug() {
|
70 |
+
|
71 |
+
// Bail out if not on correct page
|
72 |
+
if (
|
73 |
+
! isset( $_GET['_wpnonce'] )
|
74 |
+
||
|
75 |
+
(
|
76 |
+
! wp_verify_nonce( $_GET['_wpnonce'], 'user-photo-nonce' )
|
77 |
+
||
|
78 |
+
! is_admin()
|
79 |
+
||
|
80 |
+
! isset( $_GET[self::NO_BUG_OPTION] )
|
81 |
+
||
|
82 |
+
! current_user_can( 'manage_options' )
|
83 |
+
)
|
84 |
+
) {
|
85 |
+
return;
|
86 |
+
}
|
87 |
+
|
88 |
+
add_site_option( self::NO_BUG_OPTION, true );
|
89 |
+
|
90 |
+
}
|
91 |
+
|
92 |
+
}
|
93 |
+
new User_Photo_Upgrade_Notice();
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: westonruter, ryanhellyer, glen_scott
|
|
3 |
Tags: users, photos, images
|
4 |
Requires at least: 3.0.5
|
5 |
Tested up to: 4.6
|
6 |
-
Stable tag: 0.9.
|
7 |
|
8 |
Allows a user to associate a photo with their account and for this photo to be displayed in their posts and comments.
|
9 |
|
@@ -114,6 +114,10 @@ If you value this plugin, *please donate* to ensure that it may continue to be m
|
|
114 |
|
115 |
== Changelog ==
|
116 |
|
|
|
|
|
|
|
|
|
117 |
= 0.9.9 =
|
118 |
* Removed deprecated mysql_ function
|
119 |
|
3 |
Tags: users, photos, images
|
4 |
Requires at least: 3.0.5
|
5 |
Tested up to: 4.6
|
6 |
+
Stable tag: 0.9.10
|
7 |
|
8 |
Allows a user to associate a photo with their account and for this photo to be displayed in their posts and comments.
|
9 |
|
114 |
|
115 |
== Changelog ==
|
116 |
|
117 |
+
= 0.9.10 =
|
118 |
+
* Added recommendation to upgrade in wp-admin/plugins.php
|
119 |
+
* Provided option to never see the upgrade notice again
|
120 |
+
|
121 |
= 0.9.9 =
|
122 |
* Removed deprecated mysql_ function
|
123 |
|
user-photo.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: User Photo
|
4 |
Plugin URI: http://wordpress.org/extend/plugins/user-photo/
|
5 |
Description: Allows users to associate photos with their accounts by accessing their "Your Profile" page. Uploaded images are resized to fit the dimensions specified on the options page; a thumbnail image is also generated. New template tags introduced are: <code>userphoto_the_author_photo</code>, <code>userphoto_the_author_thumbnail</code>, <code>userphoto_comment_author_photo</code>, and <code>userphoto_comment_author_thumbnail</code>. Uploaded images may be moderated by administrators.
|
6 |
-
Version: 0.9.
|
7 |
Author: <a href="http://weston.ruter.net/">Weston Ruter</a>
|
8 |
|
9 |
Original code by Weston Ruter <http://weston.ruter.net> at Shepherd Interactive <http://shepherd-interactive.com>.
|
@@ -27,6 +27,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
27 |
|
28 |
define('USERPHOTO_PLUGIN_IDENTIFIER', 'user-photo/user-photo.php');
|
29 |
|
|
|
|
|
|
|
30 |
if(!function_exists('imagecopyresampled')){
|
31 |
//Remove this from active plugins
|
32 |
$active_plugins = get_option('active_plugins');
|
3 |
Plugin Name: User Photo
|
4 |
Plugin URI: http://wordpress.org/extend/plugins/user-photo/
|
5 |
Description: Allows users to associate photos with their accounts by accessing their "Your Profile" page. Uploaded images are resized to fit the dimensions specified on the options page; a thumbnail image is also generated. New template tags introduced are: <code>userphoto_the_author_photo</code>, <code>userphoto_the_author_thumbnail</code>, <code>userphoto_comment_author_photo</code>, and <code>userphoto_comment_author_thumbnail</code>. Uploaded images may be moderated by administrators.
|
6 |
+
Version: 0.9.10
|
7 |
Author: <a href="http://weston.ruter.net/">Weston Ruter</a>
|
8 |
|
9 |
Original code by Weston Ruter <http://weston.ruter.net> at Shepherd Interactive <http://shepherd-interactive.com>.
|
27 |
|
28 |
define('USERPHOTO_PLUGIN_IDENTIFIER', 'user-photo/user-photo.php');
|
29 |
|
30 |
+
require( 'class-user-photo-upgrade-notice.php' );
|
31 |
+
|
32 |
+
|
33 |
if(!function_exists('imagecopyresampled')){
|
34 |
//Remove this from active plugins
|
35 |
$active_plugins = get_option('active_plugins');
|