This commit is contained in:
2024-05-20 15:37:46 +03:00
commit 00b7dbd0b7
10404 changed files with 3285853 additions and 0 deletions

View File

@ -0,0 +1,88 @@
<?php
namespace Nextend\SmartSlider3\Application\Admin\Help;
use Nextend\Framework\Api;
use Nextend\Framework\Model\StorageSectionManager;
use Nextend\Framework\Notification\Notification;
use Nextend\SmartSlider3\Application\Admin\AbstractControllerAdmin;
use WP_HTTP_Proxy;
class ControllerHelp extends AbstractControllerAdmin {
public function actionIndex() {
$view = new ViewHelpIndex($this);
$view->display();
}
public function actionBrowserIncompatible() {
$view = new ViewHelpBrowserIncompatible($this);
$view->display();
}
public function actionTestApi() {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, Api::getApiUrl());
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$errorFile = dirname(__FILE__) . '/curl_error.txt';
$out = fopen($errorFile, "w");
curl_setopt($ch, CURLOPT_VERBOSE, true);
curl_setopt($ch, CURLOPT_STDERR, $out);
$proxy = new WP_HTTP_Proxy();
if ($proxy->is_enabled() && $proxy->send_through_proxy(Api::getApiUrl())) {
curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);
curl_setopt($ch, CURLOPT_PROXY, $proxy->host());
curl_setopt($ch, CURLOPT_PROXYPORT, $proxy->port());
if ($proxy->use_authentication()) {
curl_setopt($ch, CURLOPT_PROXYAUTH, CURLAUTH_ANY);
curl_setopt($ch, CURLOPT_PROXYUSERPWD, $proxy->authentication());
}
}
$output = curl_exec($ch);
curl_close($ch);
fclose($out);
$log = array("API Connection Test");
$log[] = htmlspecialchars(file_get_contents($errorFile));
unlink($errorFile);
if (!empty($output)) {
$log[] = "RESPONSE: " . htmlspecialchars($output);
}
if (strpos($output, 'ACTION_MISSING') === false) {
Notification::error(sprintf(n2_('Unable to connect to the API (%1$s). %2$s See %3$sDebug Information%4$s for more details!'), Api::getApiUrl(), '<br>', '<b>', '</b>'));
} else {
Notification::notice(n2_('Successful connection with the API.'));
}
$log[] = '------------------------------------------';
$log[] = '';
StorageSectionManager::getStorage('smartslider')
->set('log', 'api', json_encode($log));
$this->redirect($this->getUrlHelp());
}
}

View File

@ -0,0 +1,284 @@
<?php
namespace Nextend\SmartSlider3\Application\Admin\Help;
use Nextend\Framework\Filesystem\Filesystem;
use Nextend\Framework\Platform\Platform;
use Nextend\Framework\Request\Request;
use Nextend\Framework\Sanitize;
use Nextend\Framework\Url\Url;
use Nextend\SmartSlider3\SmartSlider3Info;
/**
* @var $this ViewHelpIndex
*/
$conflicts = $this->getConflicts();
?>
<div class="n2_help_center">
<div class="n2_help_center__getting_started">
<div class="n2_help_center__getting_started__heading">
<?php n2_e('Welcome to Help Center'); ?>
</div>
<div class="n2_help_center__getting_started__subheading">
<?php n2_e('To help you get started, we\'ve put together a super tutorial video that shows you the basic settings.'); ?>
</div>
<div class="n2_help_center__getting_started__video">
<div class="n2_help_center__getting_started__video_placeholder"></div>
<iframe width="560" height="315" src="https://www.youtube-nocookie.com/embed/videoseries?list=PLSawiBnEUNfvVeY7M8Yx7UdyOpBEmoH7Z&rel=0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</div>
</div>
<?php
if (!empty($conflicts)) {
?>
<div class="n2_help_center__conflicts" id="n2_help_center__possible_conflicts">
<div class="n2_help_center__conflicts_icon"><i class="ssi_48 ssi_48--bug"></i></div>
<div class="n2_help_center__conflicts_label"><?php n2_e('Possible conflicts'); ?></div>
<div class="n2_help_center__conflicts_description">
<div class="n2_help_center__conflicts_test_api">
<a href="<?php echo esc_url($this->getUrlHelpTestApi()); ?>">
<?php n2_e('Test connection'); ?>
</a>
</div>
<?php
?>
<?php if (empty($conflicts)): ?>
<div class="n2_help_center__no_conflicts_detected"><?php n2_e('No conflicts detected.'); ?></div>
<?php else: ?>
<?php foreach ($conflicts as $conflict): ?>
<div class="n2_help_center__conflicts_detected"><?php echo wp_kses($conflict, Sanitize::$basicTags); ?></div>
<?php endforeach; ?>
<?php endif; ?>
</div>
</div>
<?php
}
?>
<div class="n2_help_center__search">
<div class="n2_help_center__search_heading">
<?php n2_e('Hello! How can we help you today?'); ?>
</div>
<div class="n2_help_center__search_field">
<form target="_blank" action="https://smartslider.helpscoutdocs.com/search" method="get">
<input name="query" type="text" placeholder="<?php n2_e('Search in the knowledge base'); ?>">
<button type="submit"><?php n2_e('Search'); ?></button>
</form>
</div>
</div>
<div class="n2_help_center__actions">
<div class="n2_help_center__action">
<a class="n2_help_center__action_link"
href="<?php echo esc_url('https://smartslider.helpscoutdocs.com/?utm_campaign=' . SmartSlider3Info::$campaign . '&utm_source=dashboard-documentation&utm_medium=smartslider-' . Platform::getName() . '-' . SmartSlider3Info::$plan); ?>"
target="_blank"></a>
<div class="n2_help_center__action_icon"><i class="ssi_48 ssi_48--doc"></i></div>
<div class="n2_help_center__action_label"><?php n2_e('Documentation'); ?></div>
<div class="n2_help_center__action_description"><?php n2_e('To get started with Smart Slider 3, please refer to this guide for downloading, installing, and using.'); ?></div>
</div>
<div class="n2_help_center__action">
<a class="n2_help_center__action_link" href="https://smartslider3.com/contact-us/support/"
onclick="document.getElementById('n2_support_form').submit(); return false;"></a>
<div class="n2_help_center__action_icon"><i class="ssi_48 ssi_48--help"></i></div>
<div class="n2_help_center__action_label"><?php n2_e('Email support'); ?></div>
<div class="n2_help_center__action_description"><?php n2_e('Need one-to-one assistance? Get in touch with our Support team! We\'d love the opportunity to help you.'); ?></div>
</div>
<div class="n2_help_center__action">
<a class="n2_help_center__action_link"
href="<?php echo esc_url('https://www.youtube.com/watch?v=3PPtkRU7D74&list=PLSawiBnEUNfvVeY7M8Yx7UdyOpBEmoH7Z&utm_campaign=' . SmartSlider3Info::$campaign . '&utm_source=dashboard-watch-videos&utm_medium=smartslider-' . Platform::getName() . '-' . SmartSlider3Info::$plan); ?>"
target="_blank"></a>
<div class="n2_help_center__action_icon"><i class="ssi_48 ssi_48--camera"></i></div>
<div class="n2_help_center__action_label"><?php n2_e('Tutorial videos'); ?></div>
<div class="n2_help_center__action_description"><?php n2_e('Check our video tutorials which cover everything you need to know about Smart Slider 3.'); ?></div>
</div>
</div>
<div class="n2_help_center__articles_heading">
<?php n2_e('Selected articles'); ?>
</div>
<div class="n2_help_center__articles">
<?php
foreach ($this->getArticles() as $article) {
?>
<div class="n2_help_center__article">
<a class="n2_help_center__article_link" href="<?php echo esc_url($article['url']); ?>" target="_blank"></a>
<div class="n2_help_center__article_label"><?php echo esc_html($article['label']); ?></div>
<i class="ssi_16 ssi_16--breadcrumb n2_help_center__article_icon"></i>
</div>
<?php
}
?>
</div>
<?php
if (empty($conflicts)) {
?>
<div class="n2_help_center__conflicts" id="n2_help_center__possible_conflicts">
<div class="n2_help_center__conflicts_icon"><i class="ssi_48 ssi_48--bug"></i></div>
<div class="n2_help_center__conflicts_label"><?php n2_e('Possible conflicts'); ?></div>
<div class="n2_help_center__conflicts_description">
<div class="n2_help_center__conflicts_test_api">
<a href="<?php echo esc_url($this->getUrlHelpTestApi()); ?>">
<?php n2_e('Test connection'); ?>
</a>
</div>
<?php
?>
<?php if (empty($conflicts)): ?>
<div class="n2_help_center__no_conflicts_detected"><?php n2_e('No conflicts detected.'); ?></div>
<?php else: ?>
<?php foreach ($conflicts as $conflict): ?>
<div class="n2_help_center__conflicts_detected"><?php echo wp_kses($conflict, Sanitize::$basicTags); ?></div>
<?php endforeach; ?>
<?php endif; ?>
</div>
</div>
<?php
}
?>
<?php
?>
<div class="n2_help_center__system_information">
<div class="n2_help_center__system_information_label">
<?php n2_e('Debug information'); ?>
</div>
<form id="n2_support_form" class="n2_help_center__system_information_form" method="post"
action="https://smartslider3.com/contact-us/support/" target="_blank">
<?php
$debug = array(
'Smart Slider 3 - version: ' . SmartSlider3Info::$completeVersion,
'Plan: ' . SmartSlider3Info::$plan,
'Platform: ' . Platform::getLabel() . ' - ' . Platform::getVersion(),
'Site url: ' . Platform::getSiteUrl(),
'Path: ' . Filesystem::getBasePath(),
'Uri: ' . Url::getBaseUri(),
'Browser: ' . Request::$SERVER->getVar('HTTP_USER_AGENT'),
''
);
$curlLog = $this->getCurlLog();
if (!empty($curlLog)) {
$debug = array_merge($debug, $curlLog);
$debug[] = '';
}
if (function_exists('ini_get')) {
$debug[] = 'PHP: ' . phpversion();
$debug[] = 'PHP - memory_limit: ' . ini_get('memory_limit');
$debug[] = 'PHP - max_input_vars: ' . ini_get('max_input_vars');
$opcache = ini_get('opcache.enable');
$debug[] = 'PHP - opcache.enable: ' . intval($opcache);
if ($opcache) {
$debug[] = 'PHP - opcache.revalidate_freq: ' . ini_get('opcache.revalidate_freq');
}
$debug[] = '';
}
if (extension_loaded('gd')) {
$debug[] = 'GD modules status:';
foreach (gd_info() as $module => $status) {
$debug[] = $module . ' : ' . (!empty($status) ? $status : "0");
}
}
$debug[] = '';
if (function_exists('get_loaded_extensions')) {
$debug[] = 'Uncommon PHP extensions:';
$debug[] = implode(" \t", array_diff(get_loaded_extensions(), array(
'Core',
'openssl',
'pcre',
'zlib',
'SPL',
'session',
'standard',
'cgi-fcgi',
'mysqlnd',
'PDO',
'bz2',
'calendar',
'filter',
'hash',
'Reflection',
'zip',
'Zend OPcache',
'shmop',
'sodium',
'date',
'dom',
'ctype',
'xml',
'libxml',
'fileinfo',
'ftp',
'gettext',
'iconv',
'intl',
'json',
'exif',
'mysqli',
'pdo_mysql',
'Phar',
'posix',
'readline',
'SimpleXML',
'soap',
'sockets',
'sysvmsg',
'sysvsem',
'sysvshm',
'tokenizer',
'wddx',
'xmlreader',
'xmlwriter',
'xsl'
)));
$debug[] = '';
}
$debugConflicts = $this->getDebugConflicts();
if (empty($debugConflicts)) {
$debug[] = 'No conflicts detected';
} else {
$debug[] = 'Conflicts:';
foreach ($debugConflicts as $conflict) {
$debug[] = ' - ' . $conflict;
}
$debug[] = '';
}
$debug = array_merge($debug, Platform::getDebug());
?>
<textarea readonly name="debug_information"
style="width:100%;height:800px;"><?php echo esc_html(implode("\n", $debug)); ?></textarea>
</form>
</div>
</div>

View File

@ -0,0 +1,28 @@
<?php
namespace Nextend\SmartSlider3\Application\Admin\Help;
use Nextend\Framework\View\AbstractView;
use Nextend\SmartSlider3\Application\Admin\Layout\LayoutError;
class ViewHelpBrowserIncompatible extends AbstractView {
public function display() {
$this->layout = new LayoutError($this);
$browsers = array(
sprintf(n2_('%s or later'), 'Chrome 68'),
sprintf(n2_('%s or later'), 'Firefox 52'),
sprintf(n2_('%s or later'), 'Safari 10'),
sprintf(n2_('%s or later'), 'Opera 55'),
sprintf(n2_('%s or later'), 'Edge 18'),
);
$this->layout->setError(n2_('You are using an unsupported browser!'), sprintf(n2_('Smart Slider 3 does not support your current browser for editing. Supported browsers are the following: %s.'), implode(', ', $browsers)), 'https://smartslider.helpscoutdocs.com/article/1716-system-requirements');
$this->layout->render();
}
}

View File

@ -0,0 +1,113 @@
<?php
namespace Nextend\SmartSlider3\Application\Admin\Help;
use Nextend\Framework\View\AbstractView;
use Nextend\SmartSlider3\Application\Admin\Layout\LayoutDefault;
use Nextend\SmartSlider3\Application\Admin\TraitAdminUrl;
use Nextend\SmartSlider3\Conflict\Conflict;
class ViewHelpIndex extends AbstractView {
use TraitAdminUrl;
/** @var Conflict */
protected $conflict;
public function __construct($controller) {
parent::__construct($controller);
$this->conflict = Conflict::getInstance();
}
public function display() {
$this->layout = new LayoutDefault($this);
$this->layout->addBreadcrumb(n2_('Help center'), '', $this->getUrlHelp());
$this->layout->addContent($this->render('Index'));
$this->layout->render();
}
public function getConflicts() {
return $this->conflict->getConflicts();
}
public function getDebugConflicts() {
return $this->conflict->getDebugConflicts();
}
public function getCurlLog() {
return $this->conflict->getCurlLog();
}
/**
* @return array
*/
public function getArticles() {
$arr = array(
array(
'url' => 'https://smartslider.helpscoutdocs.com/article/1923-free-vs-pro',
'label' => 'Free vs Pro'
),
array(
'url' => 'https://smartslider.helpscoutdocs.com/article/1918-upgrading-from-free-to-pro',
'label' => 'How to update to the Pro version?'
)
);
return array_merge($arr, array(
array(
'url' => 'https://smartslider.helpscoutdocs.com/article/1916-slide-editing-in-smart-slider-3#why-is-the-slider-so-tall-on-mobile',
'label' => 'Why is the slider tall on mobile?'
),
array(
'url' => 'https://smartslider.helpscoutdocs.com/article/1916-slide-editing-in-smart-slider-3',
'label' => 'Slide editing in Smart Slider 3'
),
array(
'url' => 'https://smartslider.helpscoutdocs.com/article/1922-how-to-set-your-background-image#cropped',
'label' => 'Why are my images cropped?'
),
array(
'url' => 'https://smartslider.helpscoutdocs.com/article/1924-how-to-add-a-video',
'label' => 'How can I add a video?'
),
array(
'url' => 'https://smartslider.helpscoutdocs.com/article/1807-slider-settings-autoplay',
'label' => 'Where is the autoplay?'
),
array(
'url' => 'https://smartslider.helpscoutdocs.com/article/1919-video-autoplay-handling',
'label' => 'Why isn\'t my video autoplaying?'
),
array(
'url' => 'https://smartslider.helpscoutdocs.com/article/1925-how-to-speed-up-your-site',
'label' => 'How can I speed up my site?'
),
array(
'url' => 'https://smartslider.helpscoutdocs.com/category/1699-publishing',
'label' => 'How can I publish my sliders?'
),
array(
'url' => 'https://smartslider.helpscoutdocs.com/article/1828-using-your-own-fonts',
'label' => 'How to use different fonts in the slider?'
),
array(
'url' => 'https://smartslider.helpscoutdocs.com/article/1725-dynamic-slide-basics',
'label' => 'What is a dynamic slide?'
),
array(
'url' => 'https://smartslider.helpscoutdocs.com/collection/1712-troubleshooting',
'label' => 'Troubleshooting'
)
));
}
}