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
Issue boards
Milestones
Wiki
Code
Merge requests
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
wpdesk
wp-basic-requirements
Commits
8673ae27
You need to sign in or sign up before continuing.
Commit
8673ae27
authored
5 years ago
by
vasili.guruli
Browse files
Options
Downloads
Patches
Plain Diff
Fixed transient_delete
parent
72936574
No related branches found
No related tags found
1 merge request
!19
Feature/minimum plugin version check demo1
Pipeline
#10014
passed with warnings
5 years ago
Stage: tools
Stage: tests
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/Basic_Requirement_Checker.php
+29
-1
29 additions, 1 deletion
src/Basic_Requirement_Checker.php
src/Basic_Requirement_Checker_Factory.php
+2
-0
2 additions, 0 deletions
src/Basic_Requirement_Checker_Factory.php
with
31 additions
and
1 deletion
src/Basic_Requirement_Checker.php
+
29
−
1
View file @
8673ae27
...
...
@@ -12,6 +12,8 @@
class
WPDesk_Basic_Requirement_Checker
implements
WPDesk_Requirement_Checker
{
const
EXTENSION_NAME_OPENSSL
=
'openssl'
;
const
HOOK_ADMIN_NOTICES_ACTION
=
'admin_notices'
;
const
HOOK_PLUGIN_DEACTIVATED_ACTION
=
'deactivated_plugin'
;
const
HOOK_PLUGIN_ACTIVATED_ACTION
=
'activated_plugin'
;
const
PLUGIN_INFO_KEY_NICE_NAME
=
'nice_name'
;
const
PLUGIN_INFO_KEY_NAME
=
'name'
;
...
...
@@ -570,6 +572,33 @@
}
}
/**
* Triggers the transient delete after plugin deactivated
*
*@return void
*/
public
function
transient_delete_on_deactivated_plugin
()
{
add_action
(
self
::
HOOK_PLUGIN_DEACTIVATED_ACTION
,
array
(
$this
,
'handle_transient_delete_action'
)
);
}
/**
* Triggers the transient delete after plugin activated
*
*@return void
*/
public
function
transient_delete_on_activated_plugin
()
{
add_action
(
self
::
HOOK_PLUGIN_ACTIVATED_ACTION
,
array
(
$this
,
'handle_transient_delete_action'
)
);
}
/**
* Handles the transient delete
*
* @return void
*/
public
function
handle_transient_delete_action
()
{
delete_transient
(
self
::
PLUGIN_INFO_TRANSIENT_NAME
);
}
/**
* Should be called as WordPress action
*
...
...
@@ -581,7 +610,6 @@
foreach
(
$this
->
notices
as
$notice
)
{
echo
$notice
;
}
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/Basic_Requirement_Checker_Factory.php
+
2
−
0
View file @
8673ae27
...
...
@@ -51,6 +51,8 @@
foreach
(
$requirements
[
'plugins'
]
as
$requirement
)
{
$requirements_checker
->
add_plugin_require
(
$requirement
[
'name'
],
$requirement
[
'nice_name'
],
$requirement
[
'version'
]
);
}
$requirements_checker
->
handle_transient_delete_action
();
}
if
(
isset
(
$requirements
[
'repo_plugins'
]
)
)
{
...
...
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