Diff: STRATO-apps/wordpress_03/app/wp-content/plugins/login-customizer/src/Includes/Plugin_Meta.php
Keine Baseline-Datei – Diff nur gegen leer.
1
-
1
+
<?php
2
+
/**
3
+
* Plugin Meta Class to add meta tags on Plugins page.
4
+
*
5
+
*
6
+
* @package LoginCustomizer
7
+
* @author WPBrigade
8
+
* @copyright Copyright (c) 2021, WPBrigade
9
+
* @link https://Loginpress.pro/
10
+
* @license https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
11
+
*/
12
+
13
+
namespace LoginCustomizer\Includes;
14
+
use LoginCustomizer\Includes\Disband;
15
+
16
+
17
+
/**
18
+
* Plugin Meta class.
19
+
*
20
+
* @since 2.2.0
21
+
* @version 2.1.5
22
+
* @access public
23
+
*/
24
+
class Plugin_Meta {
25
+
26
+
/* * * * * * * * * *
27
+
* Class constructor
28
+
* * * * * * * * * */
29
+
30
+
public function __construct() {
31
+
32
+
// $this->hooks();
33
+
34
+
}
35
+
36
+
/**
37
+
* Hook into actions and filters
38
+
* @since 2.2.0
39
+
* @version 2.1.5
40
+
*/
41
+
function hooks( ) {
42
+
43
+
// include_once( LOGINCUST_DIR_PATH . 'Includes/Ajax.php' );
44
+
45
+
// add_action( 'admin_footer', array( $this, 'disband_model' ) );
46
+
add_filter( 'plugin_row_meta', array( $this, '_row_meta'), 10, 2 );
47
+
add_action( 'plugin_action_links', array( $this, 'login_customizer_action_links' ), 10, 2 );
48
+
49
+
}
50
+
51
+
/**
52
+
* Add rating icon on plugins page.
53
+
*
54
+
* @since 2.2.0
55
+
* @return void
56
+
*/
57
+
58
+
public function _row_meta( $meta_fields, $file ) {
59
+
60
+
if ( $file != 'login-customizer/login-customizer.php' ) {
61
+
62
+
return $meta_fields;
63
+
}
64
+
65
+
echo "<style>.login-customizer-rate-stars { display: inline-block; color: #ffb900; position: relative; top: 3px; }.login-customizer-rate-stars svg{ fill:#ffb900; } .login-customizer-rate-stars svg:hover{ fill:#ffb900 } .login-customizer-rate-stars svg:hover ~ svg{ fill:none; } </style>";
66
+
67
+
$plugin_rate = "https://wordpress.org/support/plugin/login-customizer/reviews/?rate=5#new-post";
68
+
$plugin_filter = "https://wordpress.org/support/plugin/login-customizer/reviews/?filter=5";
69
+
$plugin_support = "https://wordpress.org/support/plugin/login-customizer/";
70
+
$svg_xmlns = "https://www.w3.org/2000/svg";
71
+
$svg_icon = '';
72
+
73
+
for ( $i = 0; $i < 5; $i++ ) {
74
+
$svg_icon .= "<svg xmlns='" . esc_url( $svg_xmlns ) . "' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='feather feather-star'><polygon points='12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2'/></svg>";
75
+
}
76
+
$meta_fields[] = '<a href="' . esc_url( $plugin_support ) . '" target="_blank">' . __( 'Support', 'login-customizer' ) . '</a>';
77
+
// Set icon for thumbsup.
78
+
$meta_fields[] = '<a href="' . esc_url( $plugin_filter ) . '" target="_blank"><span class="dashicons dashicons-thumbs-up"></span>' . __( 'Vote!', 'login-customizer' ) . '</a>';
79
+
80
+
// Set icon for 5-star reviews. v1.1.22
81
+
$meta_fields[] = "<a href='" . esc_url( $plugin_rate ) . "' target='_blank' title='" . esc_html__( 'Rate', 'login-customizer' ) . "'><i class='login-customizer-rate-stars'>" . $svg_icon . "</i></a>";
82
+
83
+
return $meta_fields;
84
+
}
85
+
86
+
/**
87
+
* Add a link to the settings page to the plugins list
88
+
*
89
+
* @since 2.2.0
90
+
* @return void
91
+
*/
92
+
public function login_customizer_action_links( $links, $file ) {
93
+
94
+
static $this_plugin;
95
+
$options = get_option( 'login_customizer_settings', array() );
96
+
97
+
if ( empty( $this_plugin ) ) {
98
+
99
+
$this_plugin = 'login-customizer/login-customizer.php';
100
+
}
101
+
102
+
if ( $file == $this_plugin ) {
103
+
104
+
$settings_link = sprintf( esc_html__( '%1$s Customize %2$s', 'login-customizer' ), '<a href="' . add_query_arg(
105
+
array(
106
+
'autofocus[panel]' => 'logincust_panel',
107
+
'url' => rawurlencode( get_permalink( $options['page'] ) ),
108
+
),
109
+
admin_url( 'customize.php' )
110
+
) . '">', '</a>' );
111
+
$settings_link .= sprintf( esc_html__( ' | %1$s Settings %2$s ', 'login-customizer'), '<a href="' . admin_url( 'admin.php?page=login-customizer' ) . '">', '</a>' );
112
+
113
+
array_unshift( $links, $settings_link );
114
+
115
+
}
116
+
117
+
return $links;
118
+
}
119
+
120
+
/**
121
+
* Disband Model Box
122
+
*
123
+
* [Description] Option form shown on deactivation of Login Customizer
124
+
*
125
+
* @version 2.2.0
126
+
*/
127
+
function disband_model() {
128
+
global $pagenow;
129
+
130
+
if ( 'plugins.php' !== $pagenow ) {
131
+
return;
132
+
}
133
+
134
+
new Disband;
135
+
136
+
}
137
+
138
+
}
139
+
140
+