Esempio n. 1
0
        /**
         * The Get Help screen.
         *
         * Linked to from the admin About screen, this screen tells users where to go if they need help using the plugin.
         *
         * @since Achievements (3.6)
         */
        public function gethelp_screen()
        {
            global $wp_version;
            $active_plugins = array();
            $all_plugins = apply_filters('all_plugins', get_plugins());
            // Grab a ton of information about the current site - active plugins, current theme, version numbers, etc.
            // Get a list of active plugins
            foreach ($all_plugins as $filename => $plugin) {
                if ($plugin['Name'] != 'Achievements' && is_plugin_active($filename)) {
                    $active_plugins[] = $plugin['Name'] . ': ' . $plugin['Version'];
                }
            }
            natcasesort($active_plugins);
            if (!$active_plugins) {
                $active_plugins = array(__('No other plugins are active', 'achievements'));
            }
            // Is multisite active?
            if (is_multisite()) {
                if (is_subdomain_install()) {
                    $is_multisite = _x('subdomain', 'type of WordPress install', 'achievements');
                } else {
                    $is_multisite = _x('subdirectory', 'type of WordPress install', 'achievements');
                }
            } else {
                $is_multisite = __('no', 'achievements');
            }
            // Is the site NOT using pretty permalinks?
            if (empty($GLOBALS['wp_rewrite']->permalink_structure)) {
                $custom_permalinks = _x('default', 'type of permalinks', 'achievements');
                // Is the site using (almost) pretty permalinks?
            } elseif (strpos($GLOBALS['wp_rewrite']->permalink_structure, 'index.php')) {
                $custom_permalinks = _x('almost pretty', 'type of permalinks', 'achievements');
            } else {
                $custom_permalinks = _x('custom', 'type of permalinks', 'achievements');
            }
            $this->about_screen_header();
            ?>

		<style type="text/css">
		.helpushelpyou ul {
			list-style: disc;
			padding-left: 2em;
		}
		</style>

		<h3><?php 
            _e('Help and Support', 'achievements');
            ?>
</h3>
		<div class="feature-section helpushelpyou">
			<p><?php 
            printf(__('If you have questions about the plugin or need help, get in contact by leaving a message on the <a href="%s">WordPress.org support forum</a>. We&rsquo;d love to find out how you&rsquo;re using Achievements, so be sure to drop by and tell us!', 'achievements'), esc_url('https://wordpress.org/support/plugin/achievements'));
            ?>
</p>
			<p><?php 
            _e("When asking for support, please include the following information in your message; it will help us help you. Thanks!", 'achievements');
            ?>
</p>

			<h4><?php 
            _e('Versions', 'achievements');
            ?>
</h4>
			<ul>
				<li><?php 
            echo esc_html(sprintf(__('Achievements: %s', 'achievements'), achievements()->version));
            ?>
</li>
				<li><?php 
            echo esc_html(sprintf('DPA_DATA_STORE: %s', constant('DPA_DATA_STORE')));
            ?>
</li>
				<li><?php 
            echo esc_html(sprintf(__('MySQL: %s', 'achievements'), $GLOBALS['wpdb']->db_version()));
            ?>
</li>
				<li><?php 
            echo esc_html(sprintf(__('Permalinks: %s', 'achievements'), $custom_permalinks));
            ?>
</li>
				<li><?php 
            echo esc_html(sprintf(__('PHP: %s', 'achievements'), phpversion()));
            ?>
</li>
				<li><?php 
            echo esc_html(sprintf(__('Templates: %s', 'achievements'), dpa_get_theme_package_id()));
            ?>
 </li>
				<li><?php 
            echo esc_html(sprintf(__('WordPress: %s', 'achievements'), $wp_version));
            ?>
</li>
				<li><?php 
            echo esc_html(sprintf(__('WordPress multisite: %s', 'achievements'), $is_multisite));
            ?>
</li>
			</ul>

			<h4><?php 
            _e('Theme', 'achievements');
            ?>
</h4>
			<ul>
				<li><?php 
            echo esc_html(sprintf(__('Theme name: %s', 'achievements'), get_stylesheet()));
            ?>
</li>

				<?php 
            if (is_child_theme()) {
                ?>
					<li><?php 
                echo esc_html(sprintf(__('Parent theme name: %s', 'achievements'), get_template()));
                ?>
</li>
				<?php 
            }
            ?>
			</ul>

			<h4><?php 
            _e('Active Plugins', 'achievements');
            ?>
</h4>
			<ul>
				<?php 
            foreach ($active_plugins as $plugin) {
                ?>
					<li><?php 
                echo esc_html($plugin);
                ?>
</li>
				<?php 
            }
            ?>
			</ul>
		</div><!-- .feature-section -->

		</div><!-- .about-wrap -->
		<?php 
        }
Esempio n. 2
0
/**
 * Theme compatibility templates settings.
 *
 * This is used as a mechanisim for facilitating significant/breaking changes to existing templates where we want to try to maintain backwards compatibility.
 *
 * @since Achievements (3.6)
 */
function dpa_admin_setting_callback_theme_package_id()
{
    $theme_options = '';
    $current_package = dpa_get_theme_package_id('default');
    foreach ((array) achievements()->theme_compat->packages as $id => $theme) {
        $theme_options .= sprintf('<option value="%s" %s>%s</option>', esc_attr($id), selected($theme->id, $current_package, false), esc_html($theme->name));
    }
    if ($theme_options) {
        ?>
		<select name="_dpa_theme_package_id" id="_dpa_theme_package_id" <?php 
        dpa_maybe_admin_setting_disabled('_dpa_theme_package_id');
        ?>
><?php 
        echo $theme_options;
        ?>
</select>
	<?php 
    }
}
Esempio n. 3
0
 /**
  * Setup the default Achievements theme compatibility location.
  *
  * @since Achievements (3.0)
  */
 public function setup_theme()
 {
     // Bail if something already has this under control
     if (!empty($this->theme_compat->theme)) {
         return;
     }
     // Setup the theme package to use for compatibility
     dpa_setup_theme_compat(dpa_get_theme_package_id());
 }