Ejemplo n.º 1
0
_wpl_import($this->tpl_path . '.scripts.js');
_wpl_import('libraries.activities');
?>
<div class="wrap wpl-wp wpl-dashboard-wp">

    <header>
        <div class="wpl-icon-header wpl-icon-dashboard"></div>
        <h2>
            <?php 
echo __('WPL', WPL_TEXTDOMAIN);
?>
&nbsp;<?php 
echo wpl_global::check_addon('pro') ? 'PRO' : 'Basic';
?>
            <span class="wpl-dashboard-ver">v<?php 
echo wpl_global::wpl_version();
?>
</span>
        </h2>
    </header>

    <div id="dashboard-links-wp">
        <ul>
            <?php 
foreach ($this->submenus as $submenu) {
    ?>
                <li class="link-<?php 
    echo $submenu->id;
    ?>
">
                    <a href="<?php 
Ejemplo n.º 2
0
 /**
  * Running necesarry queries and functions for upgrading
  * @author Howard <*****@*****.**>
  * @return void
  */
 public function upgrade_wpl()
 {
     if (wpl_folder::exists(WPL_ABSPATH . 'assets' . DS . 'upgrade' . DS . 'files')) {
         /** copy files **/
         $res = wpl_folder::copy(WPL_ABSPATH . 'assets' . DS . 'upgrade' . DS . 'files', ABSPATH, '', true);
         /** delete files **/
         wpl_folder::delete(WPL_ABSPATH . 'assets' . DS . 'upgrade' . DS . 'files');
     }
     /** run queries **/
     $query_file = WPL_ABSPATH . 'assets' . DS . 'upgrade' . DS . 'queries.sql';
     if (wpl_file::exists($query_file)) {
         $queries = wpl_file::read($query_file);
         $queries = str_replace(";\r\n", "-=++=-", $queries);
         $queries = str_replace(";\r", "-=++=-", $queries);
         $queries = str_replace(";\n", "-=++=-", $queries);
         $sqls = explode("-=++=-", $queries);
         if (function_exists('is_multisite') and is_multisite() and wpl_global::check_addon('multisite')) {
             $original_blog_id = wpl_global::get_current_blog_id();
             // Get all blogs
             $blogs = wpl_db::select("SELECT `blog_id` FROM `#__blogs`", 'loadColumn');
             foreach ($blogs as $blog) {
                 if (!isset($blog->blog_id)) {
                     continue;
                 }
                 switch_to_blog($blog->blog_id);
                 foreach ($sqls as $sql) {
                     try {
                         wpl_db::q($sql);
                     } catch (Exception $e) {
                     }
                 }
             }
             /** delete query file **/
             wpl_file::delete($query_file);
             switch_to_blog($original_blog_id);
         } else {
             foreach ($sqls as $sql) {
                 try {
                     wpl_db::q($sql);
                 } catch (Exception $e) {
                 }
             }
             /** delete query file **/
             wpl_file::delete($query_file);
         }
     }
     /** run script **/
     $script_file = WPL_ABSPATH . 'assets' . DS . 'upgrade' . DS . 'script.php';
     if (wpl_file::exists($script_file)) {
         include $script_file;
         /** delete script file **/
         wpl_file::delete($script_file);
     }
     /** update WPL version in db **/
     update_option('wpl_version', wpl_global::wpl_version());
 }
Ejemplo n.º 3
0
 /**
  * Checks Realtyna billing credentials
  * @author Howard <*****@*****.**>
  * @static
  * @return array
  */
 public static function check_realtyna_credentials()
 {
     /** import settings library **/
     _wpl_import('libraries.settings');
     $current_url = wpl_global::get_full_url();
     $domain = wpl_global::domain($current_url);
     $settings = wpl_global::get_settings();
     $phpver = phpversion();
     $wplversion = wpl_global::wpl_version();
     $wpversion = wpl_global::wp_version();
     $username = $settings['realtyna_username'];
     $password = $settings['realtyna_password'];
     $POST = array('domain' => $domain, 'wpversion' => $wpversion, 'wplversion' => $wplversion, 'phpver' => $phpver, 'username' => urlencode($username), 'password' => urlencode($password), 'command' => 'check_credentials', 'format' => 'json');
     $io_handler = 'http://billing.realtyna.com/io/io.php';
     $result = wpl_global::get_web_page($io_handler, $POST);
     $answer = json_decode($result, true);
     /** saving status **/
     $status = isset($answer['status']) ? $answer['status'] : 0;
     wpl_settings::save_setting('realtyna_verified', $status, 1);
     $message = $status ? __('Credentials verified.', WPL_TEXTDOMAIN) : __('Invalid credentials!', WPL_TEXTDOMAIN);
     $success = 1;
     return array('success' => $success, 'message' => $message, 'status' => $status);
 }