lets do this

This commit is contained in:
sbyrd 2022-10-05 21:30:07 -04:00
commit 21314d8593
7 changed files with 69 additions and 0 deletions

8
.idea/.gitignore vendored Normal file
View File

@ -0,0 +1,8 @@
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

7
.idea/laravel-plugin.xml Normal file
View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="LaravelPluginSettings">
<option name="routerNamespace" value="" />
<option name="mainLanguage" value="en" />
</component>
</project>

8
.idea/modules.xml Normal file
View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/wp_staging_plugin_disabler.iml" filepath="$PROJECT_DIR$/.idea/wp_staging_plugin_disabler.iml" />
</modules>
</component>
</project>

4
.idea/php.xml Normal file
View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="PhpProjectSharedConfiguration" php_language_level="7.3" />
</project>

6
.idea/vcs.xml Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

View File

@ -0,0 +1,28 @@
<?php
/*
Plugin Name: Wp Staging Plugin Disabler
Plugin URI: https://cooini.com/services/dev/wordpress
Description: This plugin will disable plugins that should be disabled in a staging environment
Version: 1.0
Author: sbyrd
Author URI: https://cooini.com/
License: MINE-all-mine
*/
require_once(ABSPATH . 'wp-admin/includes/plugin.php');
$constant_requirements = ['WP_ENVIRONMENT_TYPE'=>'staging'];
$plugins = ['fluent-smtp/fluent-smtp.php'];
//Loop through our constants requirements
foreach($constant_requirements as $constant => $requirement)
{
if (constant($constant) === $requirement)
{
//Our constant requirement is meet. Plugins need to be disabled
deactivate_plugins($plugins);
break; // We only need one constant requirement to be meet
}
}