Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
W
wp-basic-requirements
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
wpdesk
wp-basic-requirements
Commits
167246cc
Commit
167246cc
authored
5 years ago
by
Grzegorz Rola
Browse files
Options
Downloads
Plain Diff
Merge branch 'feature/wp-nonce' into 'master'
Feature/wp nonce See merge request
!16
parents
b9517207
19a1917d
No related branches found
No related tags found
1 merge request
!16
Feature/wp nonce
Pipeline
#9169
passed with stages
in 47 seconds
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CHANGELOG.md
+4
-0
4 additions, 0 deletions
CHANGELOG.md
src/Basic_Requirement_Checker.php
+9
-5
9 additions, 5 deletions
src/Basic_Requirement_Checker.php
with
13 additions
and
5 deletions
CHANGELOG.md
+
4
−
0
View file @
167246cc
## [3.0.4] - 2019-09-20
### Fixed
-
Fixed missing wp_nonce_url function
## [3.0.3] - 2019-09-20
## [3.0.3] - 2019-09-20
### Fixed
### Fixed
-
Fixed "" in translation
-
Fixed "" in translation
...
...
This diff is collapsed.
Click to expand it.
src/Basic_Requirement_Checker.php
+
9
−
5
View file @
167246cc
...
@@ -310,10 +310,11 @@ if ( ! class_exists( 'WPDesk_Basic_Requirement_Checker' ) ) {
...
@@ -310,10 +310,11 @@ if ( ! class_exists( 'WPDesk_Basic_Requirement_Checker' ) ) {
* @return string
* @return string
*/
*/
private
function
prepare_plugin_repository_install_url
(
$plugin_info
)
{
private
function
prepare_plugin_repository_install_url
(
$plugin_info
)
{
$slug
=
basename
(
$plugin_info
[
self
::
PLUGIN_INFO_KEY_NAME
]
);
$slug
=
basename
(
$plugin_info
[
self
::
PLUGIN_INFO_KEY_NAME
]
);
$install_url
=
wp_nonce_url
(
self_admin_url
(
'update.php?action=install-plugin&plugin='
.
$slug
),
$install_url
=
self_admin_url
(
'update.php?action=install-plugin&plugin='
.
$slug
);
'install-plugin_'
.
$slug
);
if
(
function_exists
(
'wp_nonce_url'
)
)
{
$install_url
=
wp_nonce_url
(
$install_url
,
'install-plugin_'
.
$slug
);
}
add_filter
(
'plugins_api'
,
function
(
$api
,
$action
,
$args
)
use
(
$plugin_info
,
$slug
)
{
add_filter
(
'plugins_api'
,
function
(
$api
,
$action
,
$args
)
use
(
$plugin_info
,
$slug
)
{
if
(
'plugin_information'
!==
$action
||
if
(
'plugin_information'
!==
$action
||
false
!==
$api
||
false
!==
$api
||
...
@@ -351,7 +352,10 @@ if ( ! class_exists( 'WPDesk_Basic_Requirement_Checker' ) ) {
...
@@ -351,7 +352,10 @@ if ( ! class_exists( 'WPDesk_Basic_Requirement_Checker' ) ) {
$this
->
get_text_domain
()
),
array
(
'a'
=>
array
(
'href'
=>
array
()
)
)
),
$this
->
get_text_domain
()
),
array
(
'a'
=>
array
(
'href'
=>
array
()
)
)
),
$this
->
plugin_name
,
$nice_name
,
esc_url
(
$install_url
),
$nice_name
)
);
$this
->
plugin_name
,
$nice_name
,
esc_url
(
$install_url
),
$nice_name
)
);
}
}
$activate_url
=
'plugins.php?action=activate&plugin='
.
urlencode
(
$plugin_info
[
self
::
PLUGIN_INFO_KEY_NAME
]
)
.
'&plugin_status=all&paged=1&s&_wpnonce='
.
urlencode
(
wp_create_nonce
(
'activate-plugin_'
.
$name
)
);
$activate_url
=
'plugins.php?action=activate&plugin='
.
urlencode
(
$plugin_info
[
self
::
PLUGIN_INFO_KEY_NAME
]
)
.
'&plugin_status=all&paged=1&s'
;
if
(
function_exists
(
'wp_create_nonce'
)
)
{
$activate_url
.
=
'&_wpnonce='
.
urlencode
(
wp_create_nonce
(
'activate-plugin_'
.
$name
)
);
}
return
$this
->
prepare_notice_message
(
sprintf
(
wp_kses
(
__
(
'The “%s” plugin requires activating %s plugin. <a href="%s">Activate %s →</a>'
,
return
$this
->
prepare_notice_message
(
sprintf
(
wp_kses
(
__
(
'The “%s” plugin requires activating %s plugin. <a href="%s">Activate %s →</a>'
,
$this
->
get_text_domain
()
),
array
(
'a'
=>
array
(
'href'
=>
array
()
)
)
),
$this
->
get_text_domain
()
),
array
(
'a'
=>
array
(
'href'
=>
array
()
)
)
),
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment