plugin updates

This commit is contained in:
Tony Volpe
2024-07-16 13:57:46 +00:00
parent 41f50eacc4
commit 8f93917880
1529 changed files with 259452 additions and 25451 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 290 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 301 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 631 KiB

View File

@@ -0,0 +1,97 @@
<?php
/* Prohibit direct script loading */
defined('ABSPATH') || die('No direct script access allowed!');
?>
<form method="post">
<?php wp_nonce_field('wpmf-setup-wizard', 'wizard_nonce'); ?>
<div class="wizard-header large-content-width">
<div class="title font-size-35"><?php esc_html_e('Additional Features', 'wpmf'); ?></div>
<p class="description"><?php esc_html_e('We will guide you through the plugin main settings, You can also onfigure it later and skip the wizard', 'wpmf') ?></p>
</div>
<div class="wizard-content large-content-width">
<div class="ju-settings-option cboption" style="height: 200px; overflow: hidden; text-overflow: ellipsis; margin-right: 20px">
<div class="wpmf_row_full p-d-20">
<input type="hidden" name="wpmf_option_mediafolder" value="0">
<label data-wpmftippy="<?php esc_html_e('Load WP Media Folder files on frontend. Activate it if
you want to use a frontend page builder along with the media manager', 'wpmf'); ?>"
class="ju-setting-label text"><?php esc_html_e('WP Media Folder on frontend', 'wpmf') ?></label>
<div class="ju-switch-button">
<label class="switch">
<input type="checkbox" name="wpmf_option_mediafolder"
value="1">
<span class="slider round"></span>
</label>
</div>
<p class="description text_left p-d-20 border-top-e4e8ed">
<?php esc_html_e('Load WP Media Folder files on frontend. Activate it if
you want to use a frontend page builder along with the media manager', 'wpmf'); ?>
</p>
</div>
</div>
<div class="ju-settings-option cboption" style="height: 200px; overflow: hidden; text-overflow: ellipsis;">
<div class="wpmf_row_full p-d-20">
<input type="hidden" name="hide_remote_video" value="0">
<label data-wpmftippy="<?php esc_html_e('Enable or disable remote video feature', 'wpmf'); ?>"
class="ju-setting-label text"><?php esc_html_e('Enable remote video feature', 'wpmf') ?></label>
<div class="ju-switch-button">
<label class="switch">
<input type="checkbox" name="hide_remote_video"
value="1" checked>
<span class="slider round"></span>
</label>
</div>
<p class="description text_left p-d-20 border-top-e4e8ed">
<?php esc_html_e('Enable or disable remote video feature', 'wpmf'); ?>
</p>
</div>
</div>
<div class="ju-settings-option cboption" style="height: 200px; overflow: hidden; text-overflow: ellipsis; margin-right: 20px">
<div class="wpmf_row_full p-d-20">
<input type="hidden" name="wpmf_option_override" value="0">
<label data-wpmftippy="<?php esc_html_e('Possibility to replace an existing file by another one.', 'wpmf'); ?>"
class="ju-setting-label text"><?php esc_html_e('Override file', 'wpmf') ?></label>
<div class="ju-switch-button">
<label class="switch">
<input type="checkbox" id="cb_option_override"
name="wpmf_option_override" value="1" checked>
<span class="slider round"></span>
</label>
</div>
<p class="description text_left p-d-20 border-top-e4e8ed">
<?php esc_html_e('Possibility to replace an existing file by another one.', 'wpmf'); ?>
</p>
</div>
</div>
<div class="ju-settings-option cboption" style="height: 200px; overflow: hidden; text-overflow: ellipsis;">
<div class="wpmf_row_full p-d-20">
<input type="hidden" name="wpmf_option_duplicate" value="0">
<label data-wpmftippy="<?php esc_html_e('Add a button to duplicate a media from the media manager', 'wpmf'); ?>"
class="ju-setting-label text"><?php esc_html_e('Duplicate file', 'wpmf') ?>
</label>
<div class="ju-switch-button">
<label class="switch">
<input type="checkbox" id="cb_option_duplicate"
name="wpmf_option_duplicate" value="1" checked>
<span class="slider round"></span>
</label>
</div>
<p class="description text_left p-d-20 border-top-e4e8ed">
<?php esc_html_e('Add a button to duplicate a media from the media manager', 'wpmf'); ?>
</p>
</div>
</div>
</div>
<div class="wizard-footer">
<div class="wpmf_row_full">
<input type="submit" value="<?php esc_html_e('Continue', 'wpmf'); ?>" class="m-tb-20"
name="wpmf_save_step"/>
</div>
<a href="<?php echo esc_url(admin_url('options-general.php?page=option-folder'))?>" class="go-to-dash"><span><?php esc_html_e('I know what I\'m doing, skip wizard', 'wpmf'); ?></span></a>
</div>
</form>

View File

@@ -0,0 +1,26 @@
<?php
/* Prohibit direct script loading */
defined('ABSPATH') || die('No direct script access allowed!');
$image_src = WPMF_PLUGIN_URL . 'class/install-wizard/content/checklist-icon.png';
$srcset2x = WPMF_PLUGIN_URL . 'class/install-wizard/content/done/done-illustration@2x.png';
$srcset3x = WPMF_PLUGIN_URL . 'class/install-wizard/content/done/done-illustration@3x.png';
?>
<div class="wizard-content-done">
<div class="wizard-done">
<div class="wizard-done-image">
<img src="<?php echo esc_url(WPMF_PLUGIN_URL . 'class/install-wizard/content/done/done-illustration.png'); ?>"
srcset="<?php echo esc_url($srcset2x); ?> 2x,<?php echo esc_url($srcset3x); ?> 3x" class="Illustration---Done">
</div>
<div class="wizard-done-container">
<div class="title"><?php esc_html_e('Done', 'wpmf') ?></div>
<p class="description">
<?php esc_html_e('You have now completed the plugin quick configuration', 'wpmf') ?>
</p>
</div>
<div class="wizard-done-footer configuration-footer">
<a href="<?php echo esc_url(admin_url('upload.php')) ?>" class="button">
<?php esc_html_e('GO TO MEDIA LIBRARY', 'wpmf'); ?></a>
</div>
</div>
</div>

View File

@@ -0,0 +1,126 @@
<?php
/* Prohibit direct script loading */
defined('ABSPATH') || die('No direct script access allowed!');
?>
<form method="post">
<?php wp_nonce_field('wpmf-setup-wizard', 'wizard_nonce'); ?>
<div class="wizard-header">
<div class="title font-size-35"><?php esc_html_e('Environment Check', 'wpmf'); ?></div>
<p class="description">
<?php esc_html_e('We have checked your server environment.
If you see some warning below it means that some plugin features may not work properly.
Reload the page to refresh the results', 'wpmf'); ?>
</p>
</div>
<div class="wizard-content">
<div class="version-container">
<div class="label_text"><?php esc_html_e('PHP Version', 'wpmf'); ?></div>
<div class="ju-settings-option wpmf_width_100">
<div class="wpmf_row_full">
<label class="ju-setting-label php_version">
<?php esc_html_e('PHP ', 'wpmf'); ?>
<?php echo esc_html(PHP_VERSION) ?>
<?php esc_html_e('version', 'wpmf'); ?>
</label>
<div class="right-checkbox">
<?php if (version_compare(PHP_VERSION, '5.6', '<')) : ?>
<img src="<?php echo esc_url(WPMF_PLUGIN_URL . '/assets/images/icon-information/icon-information.png') ?>"
srcset="<?php echo esc_url(WPMF_PLUGIN_URL . '/assets/images/icon-information/icon-information@2x.png') ?> 2x, <?php echo esc_url(WPMF_PLUGIN_URL . '/assets/images/icon-information/icon-information@3x.png') ?> 3x"
class="img_warning">
<?php else : ?>
<input type="checkbox" checked disabled class="filled-in media_checkbox"/>
<?php endif; ?>
</div>
</div>
</div>
<?php if (version_compare(PHP_VERSION, '5.6', '<')) : ?>
<p class="description text_left">
<?php esc_html_e('Your PHP version is ', 'wpmf'); ?>
<?php echo esc_html(PHP_VERSION) ?>
<?php esc_html_e('. For performance and security reasons it better to run PHP 7.2+. Comparing to previous versions the execution time of PHP 7.X is more than twice as fast and has 30 percent lower memory consumption', 'wpmf'); ?>
</p>
<?php else : ?>
<p class="description">
<?php esc_html_e('Great ! Your PHP version is ', 'wpmf'); ?>
<?php echo esc_html(PHP_VERSION) ?>
</p>
<?php endif; ?>
</div>
<div class="other-container">
<div class="label_text"><?php esc_html_e('PHP Extensions', 'wpmf'); ?></div>
<div class="ju-settings-option wpmf_width_100">
<div class="wpmf_row_full">
<label class="ju-setting-label"><?php esc_html_e('Curl', 'wpmf'); ?></label>
<div class="right-checkbox">
<?php if (!in_array('curl', get_loaded_extensions())) : ?>
<img src="<?php echo esc_url(WPMF_PLUGIN_URL . '/assets/images/icon-information/icon-information.png') ?>"
srcset="<?php echo esc_url(WPMF_PLUGIN_URL . '/assets/images/icon-information/icon-information@2x.png') ?> 2x, <?php echo esc_url(WPMF_PLUGIN_URL . '/assets/images/icon-information/icon-information@3x.png') ?> 3x"
class="img_warning">
<?php else : ?>
<input type="checkbox" id="php_curl" name="php_curl" checked
value="php_curl" disabled class="filled-in media_checkbox"/>
<?php endif; ?>
</div>
</div>
</div>
<?php if (!in_array('curl', get_loaded_extensions())) : ?>
<p class="description text_left">
<?php esc_html_e('PHP Curl extension has not been detected. You need to activate in order to load video in media library and for all the cloud connections (like Google Drive, Dropbox...)', 'wpmf'); ?>
</p>
<?php endif; ?>
<div class="ju-settings-option wpmf_width_100">
<div class="wpmf_row_full">
<label class="ju-setting-label"><?php esc_html_e('GD Library', 'wpmf'); ?></label>
<div class="right-checkbox">
<?php if (function_exists('gd_info')) : ?>
<input type="checkbox" id="gd_info" name="gd_info" checked
value="gd_info" disabled class="filled-in media_checkbox"/>
<?php else : ?>
<img src="<?php echo esc_url(WPMF_PLUGIN_URL . '/assets/images/icon-information/icon-information.png') ?>"
srcset="<?php echo esc_url(WPMF_PLUGIN_URL . '/assets/images/icon-information/icon-information@2x.png') ?> 2x, <?php echo esc_url(WPMF_PLUGIN_URL . '/assets/images/icon-information/icon-information@3x.png') ?> 3x"
class="img_warning">
<?php endif; ?>
</div>
</div>
</div>
<?php if (!function_exists('gd_info')) : ?>
<p class="description text_left">
<?php esc_html_e('GD library is not detected. GD is an open source library related to image creation. The Watermark feature wont work.', 'wpmf'); ?>
</p>
<?php endif; ?>
<div class="label_text"><?php esc_html_e('PHP Settings', 'wpmf'); ?></div>
<div class="ju-settings-option wpmf_width_100">
<div class="wpmf_row_full">
<label class="ju-setting-label"><?php esc_html_e('Allow URL open', 'wpmf'); ?></label>
<div class="right-checkbox">
<?php if (!ini_get('allow_url_fopen')) : ?>
<img src="<?php echo esc_url(WPMF_PLUGIN_URL . '/assets/images/icon-information/icon-information.png') ?>"
srcset="<?php echo esc_url(WPMF_PLUGIN_URL . '/assets/images/icon-information/icon-information@2x.png') ?> 2x, <?php echo esc_url(WPMF_PLUGIN_URL . '/assets/images/icon-information/icon-information@3x.png') ?> 3x"
class="img_warning">
<?php else : ?>
<input type="checkbox" id="php_allow_url_fopen" name="php_allow_url_fopen" checked
value="php_allow_url_fopen" disabled class="filled-in media_checkbox"/>
<?php endif; ?>
</div>
</div>
</div>
<?php if (!ini_get('allow_url_fopen')) : ?>
<p class="description text_left">
<?php esc_html_e('Allow URL fopen setting has not been detected. You need to activate in order to use remote video feature', 'wpmf'); ?>
</p>
<?php endif; ?>
</div>
</div>
<div class="wizard-footer">
<input type="submit" value="<?php esc_html_e('Continue', 'wpmf'); ?>" class="" name="wpmf_save_step"/>
</div>
</form>

View File

@@ -0,0 +1,62 @@
<?php
/* Prohibit direct script loading */
defined('ABSPATH') || die('No direct script access allowed!');
$wizard = new WpmfInstallWizard();
// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- View request, no action
$step = isset($_GET['step']) ? sanitize_key($_GET['step']) : '';
$next_link = $wizard->getNextLink($step);
?>
<form method="post" id="quick-config-form">
<?php wp_nonce_field('wpmf-setup-wizard', 'wizard_nonce'); ?>
<input type="hidden" name="wpmf_save_step" value="1"/>
<div class="wizard-header">
<div class="title font-size-35"><?php esc_html_e('Image Configuration', 'wpmf'); ?></div>
<p class="description"><?php esc_html_e('We will guide you through the plugin main settings. You can also configure it later and skip the wizard', 'wpmf') ?></p>
</div>
<div class="wizard-content">
<div class="ju-settings-option wpmf_width_100 wpmf-no-shadow">
<div class="wpmf_row_full">
<input type="hidden" name="wpmf_usegellery" value="0">
<label class="ju-setting-label text">
<?php esc_html_e('WP Media Folder Galleries', 'wpmf') ?>
</label>
<div class="ju-switch-button">
<label class="switch">
<input type="checkbox" name="wpmf_usegellery" value="1" checked>
<span class="slider round"></span>
</label>
</div>
<p class="description text_left p-d-20">
<?php esc_html_e('Enhance the Wordpress default gallery system by adding themes and additional parameters in the gallery manager', 'wpmf'); ?>
</p>
</div>
</div>
<div class="ju-settings-option wpmf_width_100 wpmf-no-shadow">
<div class="wpmf_row_full">
<input type="hidden" name="wpmf_usegellery_lightbox" value="0">
<label class="ju-setting-label text">
<?php esc_html_e('Gallery Lightbox', 'wpmf') ?></label>
<div class="ju-switch-button">
<label class="switch">
<input type="checkbox" name="wpmf_usegellery_lightbox" value="1" checked>
<span class="slider round"></span>
</label>
</div>
<p class="description text_left p-d-20">
<?php esc_html_e('Add lightbox to images in Wordpress default galleries', 'wpmf'); ?>
</p>
</div>
</div>
</div>
<div class="wizard-footer">
<div class="wpmf_row_full">
<input type="submit" value="<?php esc_html_e('Continue', 'wpmf'); ?>" class="m-tb-20"
name="wpmf_save_step"/>
</div>
<a href="<?php echo esc_url(admin_url('options-general.php?page=option-folder'))?>" class="go-to-dash"><span><?php esc_html_e('I know what I\'m doing, skip wizard', 'wpmf'); ?></span></a>
</div>
</form>

View File

@@ -0,0 +1,30 @@
<?php
/* Prohibit direct script loading */
defined('ABSPATH') || die('No direct script access allowed!');
$image_src = WPMF_PLUGIN_URL . 'class/install-wizard/content/welcome-illustration.png';
?>
<form method="post">
<div class="start-wizard">
<div class="start-wizard-image">
<img src="<?php echo esc_url($image_src); ?>"
srcset=""
class="Illustration---Done" />
</div>
<div class="start-wizard-container">
<div class="title">
<?php esc_html_e('Welcome to WP Media Folder Settings first configuration wizard!', 'wpmf') ?>
</div>
<p class="description">
<?php esc_html_e('This wizard will help you with some server compatibility check and with plugin main configuration. Follow some simple steps and get a powerful media library in no time', 'wpmf') ?>
</p>
</div>
<div class="start-wizard-footer configuration-footer">
<a href="<?php echo esc_url(add_query_arg('step', 'environment', remove_query_arg('activate_error')))?>" class="next-button">
<?php esc_html_e('Continue to environment check', 'wpmf'); ?>
</a>
<a href="<?php echo esc_url(admin_url('options-general.php?page=option-folder'))?>" class="backup-button">
<?php esc_html_e('I know what I\'m doing, skip wizard', 'wpmf'); ?></a>
</div>
</div>
</form>

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 KiB

View File

@@ -0,0 +1,100 @@
<?php
if (!defined('ABSPATH')) {
exit;
}
/**
* Class WpmfHandlerWizard
*/
class WpmfHandlerWizard
{
/**
* WpmfHandlerWizard constructor.
*/
public function __construct()
{
}
/**
* Save Environment handle
*
* @param string $current_step Current step
*
* @return void
*/
public static function saveEvironment($current_step)
{
check_admin_referer('wpmf-setup-wizard', 'wizard_nonce');
/*
* Do no thing
*/
$wizard = new WpmfInstallWizard();
wp_safe_redirect(esc_url_raw($wizard->getNextLink($current_step)));
exit;
}
/**
* Save Quick configuration handle
*
* @param string $current_step Current step
*
* @return void
*/
public static function saveImageConfiguration($current_step)
{
check_admin_referer('wpmf-setup-wizard', 'wizard_nonce');
WP_Filesystem();
$options = array(
'wpmf_usegellery' => 1,
'wpmf_usegellery_lightbox' => 1
);
foreach ($options as $name => $value) {
if (isset($_POST[$name])) {
update_option($name, $_POST[$name]);
} else {
update_option($name, $value);
}
}
$wizard = new WpmfInstallWizard();
wp_safe_redirect(esc_url_raw($wizard->getNextLink($current_step)));
exit;
}
/**
* Save Main optimization handle
*
* @param string $current_step Current step
*
* @return void
*/
public static function saveAdditionalFeatures($current_step)
{
WP_Filesystem();
check_admin_referer('wpmf-setup-wizard', 'wizard_nonce');
$options = array(
'wpmf_option_mediafolder' => 0,
'wpmf_option_override' => 0,
'wpmf_option_duplicate' => 0
);
if (isset($_POST['hide_remote_video'])) {
wpmfSetOption('hide_remote_video', $_POST['hide_remote_video']);
} else {
wpmfSetOption('hide_remote_video', 1);
}
foreach ($options as $name => $value) {
if (isset($_POST[$name])) {
update_option($name, $_POST[$name]);
} else {
update_option($name, $value);
}
}
$wizard = new WpmfInstallWizard();
wp_safe_redirect(esc_url_raw($wizard->getNextLink($current_step)));
exit;
}
}

View File

@@ -0,0 +1,641 @@
@import "https://fonts.googleapis.com/css?family=Roboto:100,100i,300,300i,400,400i,500,500i,700,700i,900,900i&amp;subset=cyrillic,cyrillic-ext,greek,greek-ext,latin-ext,vietnamese";
body * {
font-family: 'Roboto', sans-serif;
box-sizing: border-box;
}
.title {
font-family: 'Roboto', sans-serif;
font-size: 28px;
font-weight: 500;
font-style: normal;
font-stretch: normal;
line-height: 1.61;
letter-spacing: 1px;
text-align: center;
color: #404852;
}
/* CUSTOM CSS CHECKBOXES */
input[type="checkbox"], input[type="radio"] {
border: 1px solid #b4b9be;
background: #fff;
color: #555;
clear: none;
cursor: pointer;
display: inline-block;
line-height: 0;
height: 16px;
margin: -4px 4px 0 0;
outline: 0;
padding: 0 !important;
text-align: center;
vertical-align: middle;
width: 16px;
min-width: 16px;
-webkit-appearance: none;
box-shadow: inset 0 1px 2px rgba( 0, 0, 0, 0.1 );
transition: .05s border-color ease-in-out;
}
input[type="checkbox"]:checked:before, input[type="radio"]:checked:before {
float: left;
display: inline-block;
vertical-align: middle;
width: 16px;
font: normal 21px/1 dashicons;
speak: none;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.media_checkbox {
border: 2px solid #49bf88 !important;
height: 20px !important;
width: 20px !important;
background: #fff;
border-radius: 10px;
}
.media_checkbox:checked {
background: #49bf88;
}
input[type="checkbox"]:checked:before {
color: #fff;
margin: -1px 0 0 -1px;
font-size: 17px;
content: "\f147";
}
.right-checkbox {
float: right;
line-height: 50px;
padding-right: 30px;
}
/*// BODY*/
body.wpmf-wizard-setup{
width: auto;
height: auto;
background-color: #F3F6FA;
}
.wpmf-wizard-content {
min-width: 640px;
max-width: 1280px;
margin: 0 auto;
}
.wpmf-wizard-content .wpmf-wizard-steps {
width: auto;
margin: 30px 0;
position: relative;
}
.wpmf-wizard-steps ul.wizard-steps {
margin: 0;
padding: 0;
text-align: center;
}
.wpmf-wizard-steps ul.wizard-steps li {
list-style-type: none;
padding-right: 60px;
position: relative;
display: inline-block;
}
.wpmf-wizard-steps ul.wizard-steps li:last-child {
padding-right: 0;
}
.wpmf-wizard-steps ul.wizard-steps li:not(:last-child):before {
content: '';
border-bottom: 1px dashed #ccc;
width: 60px;
position: absolute;
top: calc((100% - 1px) /2);
margin-left: 20px;
}
.wpmf-wizard-steps ul.wizard-steps li .layer {
font-size: 14px;
font-weight: 600;
width: 34px;
height: 34px;
line-height: 34px;
text-align: center;
border-radius: 100%;
border: solid 0.5px #404852;
cursor: default;
font-style: normal;
font-stretch: normal;
letter-spacing: 0.5px;
color: #404852;
}
.wpmf-wizard-steps ul.wizard-steps li a {
text-decoration: none;
}
.wpmf-wizard-steps ul.wizard-steps li.actived .layer,
.wpmf-wizard-steps ul.wizard-steps li.visited .layer {
background-color: #7391ff;
color : #fff;
cursor: pointer;
border: solid 0.5px #7391ff;
}
/*Environment Content*/
.wizard-header {
text-align: center;
width: 640px;
margin: 0 auto;
margin-bottom: 50px;
}
.wizard-content {
width: 640px;
margin: 0 auto;
}
.large-content-width {
width: 100%;
}
.wizard-content .version-container{
float: left;
width: 100%;
margin-bottom: 30px;
}
.wizard-content .version-container .details{
width: auto;
height: 60px;
line-height: 60px;
padding-left: 30px;
margin-bottom: 10px;
font-weight: bold;
font-size: 18px;
background-color: #fff;
}
.wizard-content .apache-container {
float: left;
}
.wizard-content .apache-container table,
.wizard-content .other-container table
{
border-collapse:separate;
border-spacing: 0 1em;
width: 100%;
}
.wizard-content .apache-container table tr td ,
.wizard-content .other-container table tr td {
height: 58px;
margin-bottom: 20px;
}
.wizard-content .apache-container table tr ,
.wizard-content .other-container table tr {
background-color: #fff;
}
.wizard-content .apache-container label,
.wizard-content .other-container label{
cursor: pointer;
font-weight: bold;
font-size: 16px;
padding-left: 30px;
}
.wizard-content table input {
width: 20px;
height: 20px;
}
.wizard-content .other-container {
margin: 40px 0;
float: left;
width: 100%;
}
.wizard-footer {
margin-bottom: 42px;
text-align: center;
float: left;
width: 100%;
}
.wizard-footer input {
width: 280px;
height: 60px;
background-color: #FF8538;
border: 1px solid #FF8538;
border-radius: 30px;
text-transform: uppercase;
cursor: pointer;
font-family: 'Roboto', sans-serif;
font-size: 15px;
font-weight: 500;
font-style: normal;
font-stretch: normal;
line-height: normal;
letter-spacing: 1px;
text-align: center;
color: #ffffff;
}
.wizard-footer a{
text-decoration: none;
}
/*button switch*/
.wizard-switch {
position: relative;
display: inline-block;
width: 21px;
height: 31px;
}
.wizard-switch input {display:none;}
.wizard-slider {
position: absolute;
cursor: pointer;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: #ccc;
-webkit-transition: .4s;
transition: .4s;
}
.wizard-slider:before {
position: absolute;
content: "";
height: 27px;
width: 27px;
left: 2px;
bottom: 2px;
-webkit-transition: .4s;
transition: .4s;
box-shadow: 0 3px 3px 0 rgba(0, 0, 0, 0.05), 0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 3px 1px 0 rgba(0, 0, 0, 0.05);
background-color: #ffffff;
border: solid 0.5px rgba(0, 0, 0, 0.1);
}
input:checked + .wizard-slider {
background-color: #5dca70;
}
input:focus + .wizard-slider {
box-shadow: 0 0 1px #00CC00;
}
input:checked + .wizard-slider:before {
-webkit-transform: translateX(19px);
-ms-transform: translateX(19px);
transform: translateX(19px);
}
/* Rounded sliders */
.wizard-slider.round {
border-radius: 30px;
}
.wizard-slider.round:before {
border-radius: 50%;
}
/*Wizard done*/
.wizard-content-done {
width: 450px;
top: 0;
margin: 0 auto;
}
.wizard-done-image {
width: 100%;
height: 450px;
margin: 0 auto;
margin-top: 30px;
margin-bottom: 30px;
text-align: center;
}
.wizard-done {
text-align: center;
}
.wizard-done .wizard-done-footer {
margin-top: 60px;
margin-bottom: 320px;
}
.wizard-done .wizard-done-footer a.button{
font-family: 'Roboto', sans-serif;
padding: 22px 83px;
text-decoration: none;
border-radius: 40px;
text-transform: uppercase;
background-color: #FF8538;
border: 1px solid #FF8538;
box-shadow: 10px 20px 20px 0 rgba(232, 182, 139, 0.27);
font-size: 15px;
font-weight: bold;
font-style: normal;
font-stretch: normal;
line-height: normal;
letter-spacing: 1px;
text-align: center;
color: #ffffff;
}
/*check list icon*/
.start-wizard {
width: 546px;
margin: 0 auto;
}
.start-wizard .start-wizard-image {
width: 450px;
margin: 0 auto;
margin-top: 30px;
margin-bottom: 30px;
text-align: center;
}
.start-wizard-footer {
text-align: center;
}
.start-wizard .start-wizard-footer a.next-button {
display: block;
text-decoration: none;
width: 390px;
height: 65px;
line-height: 65px;
border-radius: 40px;
text-transform: uppercase;
margin: 80px auto;
background-color: #FF8538;
border: 1px solid #FF8538;
box-shadow: 10px 20px 20px 0 rgba(232, 182, 139, 0.27);
cursor: pointer;
font-family: 'Roboto', sans-serif;
font-size: 15px;
font-weight: 500;
font-style: normal;
font-stretch: normal;
letter-spacing: 1px;
text-align: center;
color: #ffffff;
}
.backup-button {
font-family: 'Roboto', sans-serif;
text-decoration: none;
font-size: 15px;
font-weight: 500;
font-style: normal;
font-stretch: normal;
line-height: normal;
letter-spacing: 1px;
text-align: center;
color: #ff8726;
}
.go-to-dash {
font-family: 'Roboto', sans-serif;
font-size: 15px;
font-weight: 500;
font-style: normal;
font-stretch: normal;
line-height: normal;
letter-spacing: 2px;
text-align: center;
color: #ff8726;
}
.ju-settings-option {
box-sizing: border-box;
}
.ju-setting-label {
float: left;
display: inline-block;
min-width: 150px;
max-width: calc(100% - 150px);
overflow: hidden;
white-space: nowrap;
-ms-text-overflow: ellipsis;
text-overflow: ellipsis;
margin: 0;
line-height: 50px;
cursor: pointer;
font-weight: 500 !important;
padding-left: 20px;
font-size: 20px;
letter-spacing: 0.7px;
color: #404852;
font-family: 'Roboto', sans-serif;
}
.php_version {
font-family: 'Roboto', sans-serif;
font-size: 16px;
font-weight: 500;
font-style: normal;
font-stretch: normal;
letter-spacing: 0.8px;
color: #404852;
}
.img_warning {
vertical-align: middle;
}
.description {
font-family: 'Roboto', sans-serif;
text-align: center;
font-size: 16px;
font-weight: 300;
font-style: normal;
font-stretch: normal;
line-height: 1.88;
letter-spacing: 1px;
color: #606c7b;
}
.wizard-header .description,
.wizard-done-container .description {
font-family: 'Roboto', sans-serif;
font-size: 14px;
font-weight: 300;
font-style: normal;
font-stretch: normal;
line-height: 2.14;
letter-spacing: 1px;
text-align: center;
color: #404852;
}
.text_left {
text-align: left;
}
.p-d-10 {
padding: 10px;
}
.p-d-20 {
padding: 20px;
}
.p-d-40 {
padding: 40px;
}
.m-tb-20 {
margin-top: 20px;
margin-bottom: 20px;
}
.wpmf-no-margin {
margin: 0 !important;
}
.ju-settings-option {
float: left;
width: 49%;
margin-bottom: 20px;
background-color: #fff;
-webkit-box-shadow: 0 10px 30px 0 rgba(160, 166, 190, 0.08);
-moz-box-shadow: 0 10px 30px 0 rgba(160, 166, 190, 0.08);
box-shadow: 0 10px 30px 0 rgba(160, 166, 190, 0.08);
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
}
.wpmf_width_100 {
width: 100%;
max-width: 100%;
}
.wpmf-no-shadow {
box-shadow: none;
}
.wpmf_row_full {
width: 100%;
float: left;
margin: 10px 0 10px 0;
}
.ju-switch-button {
float: right;
margin-left: 10px;
margin-right: 30px;
}
.ju-switch-button .switch {
position: relative;
display: inline-block;
width: 50px;
height: 30px;
margin: 10px;
}
.ju-switch-button .switch input {
display: none;
}
.ju-switch-button .switch .slider {
position: absolute;
cursor: pointer;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: #ccc;
-webkit-transition: 0.4s;
-moz-transition: 0.4s;
-ms-transition: 0.4s;
-o-transition: 0.4s;
transition: 0.4s;
-webkit-border-radius: 40px;
-moz-border-radius: 40px;
border-radius: 40px;
}
.ju-switch-button .switch input:checked + .slider {
background-color: #5dca70;
}
.ju-switch-button .switch .slider:before {
position: absolute;
content: '';
height: 27px;
width: 27px;
left: 2px;
bottom: 2px;
background-color: #fff;
-webkit-transition: 0.4s;
-moz-transition: 0.4s;
-ms-transition: 0.4s;
-o-transition: 0.4s;
transition: 0.4s;
-webkit-border-radius: 50%;
-moz-border-radius: 50%;
border-radius: 50%;
}
.ju-switch-button .switch input:checked + .slider:before {
-webkit-transform: translateX(20px);
-moz-transform: translateX(20px);
-ms-transform: translateX(20px);
-o-transform: translateX(20px);
transform: translateX(20px);
}
input:checked + .slider:before {
-webkit-transform: translateX(26px);
-ms-transform: translateX(26px);
transform: translateX(26px);
}
.slider.round:before {
border-radius: 50%;
}
.label_text {
color: #9ea7b2;
font-size: 20px;
overflow: hidden;
white-space: nowrap;
font-family: 'Roboto', sans-serif;
font-weight: 500;
letter-spacing: 0.7px;
width: 100%;
max-width: 100%;
float: left;
margin-bottom: 15px;
}
.border-top-e4e8ed {
border-top: #e4e8ed 0.5px solid;
}
.wizard-content .description {
margin-top: 10px;
float: left;
width: 100%;
}
.font-size-35 {
font-size: 35px;
}

View File

@@ -0,0 +1,231 @@
<?php
if (!defined('ABSPATH')) {
exit;
}
require_once(WP_MEDIA_FOLDER_PLUGIN_DIR . '/class/install-wizard/handler-wizard.php');
/**
* Class WpmfInstallWizard
*/
class WpmfInstallWizard
{
/**
* Init step params
*
* @var array
*/
protected $steps = array(
'environment' => array(
'name' => 'Environment Check',
'view' => 'viewEvironment',
'action' => 'saveEvironment'
),
'image_config' => array(
'name' => 'Image Configuration',
'view' => 'viewImageConfig',
'action' => 'saveImageConfiguration'
),
'additional_features' => array(
'name' => 'Additional Features',
'view' => 'viewAdditionalFeatures',
'action' => 'saveAdditionalFeatures',
)
);
/**
* Init current step params
*
* @var array
*/
protected $current_step = array();
/**
* WpmfInstallWizard constructor.
*/
public function __construct()
{
/**
* Filter check capability of current user to run first install plugin
*
* @param boolean The current user has the given capability
* @param string Action name
*
* @return boolean
*
* @ignore Hook already documented
*/
$wpmf_capability = apply_filters('wpmf_user_can', current_user_can('manage_options'), 'first_install_plugin');
if ($wpmf_capability) {
add_action('admin_menu', array($this, 'adminMenus'));
add_action('admin_init', array($this, 'runWizard'));
}
}
/**
* Add admin menus/screens.
*
* @return void
*/
public function adminMenus()
{
add_dashboard_page('', '', 'manage_options', 'wpmf-setup', '');
}
/**
* Execute wizard
*
* @return void
*/
public function runWizard()
{
// phpcs:disable WordPress.Security.NonceVerification.Recommended -- View request, no action
wp_enqueue_style(
'wpmf_wizard',
WPMF_PLUGIN_URL . 'class/install-wizard/install-wizard.css',
array(),
WPMF_VERSION
);
// Get step
$this->steps = apply_filters('wpmf_setup_wizard_steps', $this->steps);
$this->current_step = isset($_GET['step']) ? sanitize_key($_GET['step']) : current(array_keys($this->steps));
// Save action
// phpcs:ignore WordPress.Security.NonceVerification.Missing -- No action, nonce is not required
if (!empty($_POST['wpmf_save_step']) && isset($this->steps[$this->current_step]['action'])) {
call_user_func(array('WpmfHandlerWizard', $this->steps[$this->current_step]['action']), $this->current_step);
}
// Render
$this->setHeader();
if (!isset($_GET['step'])) {
require_once(WP_MEDIA_FOLDER_PLUGIN_DIR . '/class/install-wizard/content/viewWizard.php');
} elseif (isset($_GET['step']) && $_GET['step'] === 'wizard_done') {
require_once(WP_MEDIA_FOLDER_PLUGIN_DIR . '/class/install-wizard/content/viewDone.php');
} else {
$this->setMenu();
$this->setContent();
}
// phpcs:enable
exit();
}
/**
* Get next link step
*
* @param string $step Current step
*
* @return string
*/
public function getNextLink($step = '')
{
if (!$step) {
$step = $this->current_step;
}
$keys = array_keys($this->steps);
if (end($keys) === $step) {
return add_query_arg('step', 'wizard_done', remove_query_arg('activate_error'));
}
$step_index = array_search($step, $keys, true);
if (false === $step_index) {
return '';
}
return add_query_arg('step', $keys[$step_index + 1], remove_query_arg('activate_error'));
}
/**
* Output the menu for the current step.
*
* @return void
*/
public function setMenu()
{
$output_steps = $this->steps;
?>
<div class="wpmf-wizard-steps">
<ul class="wizard-steps">
<?php
$i = 0;
foreach ($output_steps as $key => $step) {
$position_current_step = array_search($this->current_step, array_keys($this->steps), true);
$position_step = array_search($key, array_keys($this->steps), true);
$is_visited = $position_current_step > $position_step;
$i ++;
if ($key === $this->current_step) {
?>
<li class="actived"><div class="layer"><?php echo esc_html($i) ?></div></li>
<?php
} elseif ($is_visited) {
?>
<li class="visited">
<a href="<?php echo esc_url(add_query_arg('step', $key, remove_query_arg('activate_error'))); ?>">
<div class="layer"><?php echo esc_html($i) ?></div></a>
</li>
<?php
} else {
?>
<li><div class="layer"><?php echo esc_html($i) ?></div></li>
<?php
}
}
?>
</ul>
</div>
<?php
}
/**
* Output the content for the current step.
*
* @return void
*/
public function setContent()
{
echo '<div class="">';
if (!empty($this->steps[$this->current_step]['view'])) {
require_once(WP_MEDIA_FOLDER_PLUGIN_DIR . '/class/install-wizard/content/' . $this->steps[$this->current_step]['view'] . '.php');
}
echo '</div>';
}
/**
* Setup Wizard Header.
*
* @return void
*/
public function setHeader()
{
?>
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta name="viewport" content="width=device-width" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php esc_html_e('WP Media Folder &rsaquo; Setup Wizard', 'wpmf'); ?></title>
<?php wp_admin_css('dashicons', true); ?>
<?php wp_admin_css('wpmf_wizard', true); ?>
</head>
<body class="wpmf-wizard-setup wp-core-ui">
<div class="wpmf-wizard-content p-d-20">
<?php
}
/**
* Setup Wizard Footer.
*
* @return void
*/
public function setFooter()
{
?>
</div>
</body>
<?php wp_print_footer_scripts(); ?>
</html>
<?php
}
}
new WpmfInstallWizard();