• Resolved Bryan Willis

    (@codecandid)


    First we need to update to work better with 4.0. There are some compatibility issues, but on top of that we have some wonderful new api options to include!

    Second I just have some basic ideas and suggestions:

    1) Include defaults that work with all themes. By using html tags like h1-h6, p, button, etc., you provide the opportunity to let this plugin work on its own without forcing the user to implement their own plugin, which is beyond what most wordpess users are capable of doing.

    2) Sadly with 75,000 downloads there are only 5 extension themes available that people have made. To fix this we just need to make it easier for add their themes. Most people don’t know how to make a wordpress plugin, let alone know subversion to be able to add a plugin to wordpess. So how can we make this all easier? First we need to make the set up easier and quicker. My proposal is to automatically generate a child plugin when first activating this plugin or have an option to download a plugin based on their current theme. If you think you’d want to implement this let me know, I’d be glad to write the plugin. If not here’s a simple function you could include on the settings page that helps people know what they’re suppose to do. You could just include this with some basic info like “copy this text into a new plugin file with a customize.json to add your own plugin.

    function admin_notice_theme($output) {
    	global $user_identity, $user_url;
    	get_currentuserinfo();
    	$my_theme = wp_get_theme();
    	$themename = $my_theme->get('Name');
    	$sitename = get_bloginfo('name');
    	$pluginuri = home_url();
    	$version = date('Y.m.d');
    	$output = '<textarea rows="10" cols="75">' . "\r\n";
    	$output.= '<?php' . "\r\n";
    	$output.= '/*' . "\r\n";
    	$output.= 'Plugin Name: tyles: ' . $themename . "\r\n";
    	$output.= 'Plugin URI: ' . $pluginuri . "\r\n";
    	$output.= 'Description: A theme specific plugin for the ' . $themename . ' theme, that adds theme customizer controls ';
    	$output.= 'using the <a href=&quot;http://wordpress.org/plugins/styles/&quot; target=&quot;_blank&quot;>Styles plugin</a>.' . "\n";
    	$output.= 'Version: ' . $version . "\n";
    	$output.= 'Author: ' . $user_identity . "\n";
    	$output.= 'Author URI: ' . $user_url . "\n";
    	$output.= 'License: GPL' . "\r\n";
    	$output.= "\r\n";
    	$output.= 'Require: Styles 1.1.9' . "\r\n";
    	$output.= 'Styles Class: Styles_Child_Theme' . "\n";
    	$output.= '*/' . "\n";
    	$output.= "\n";
    	$output.= "\n";
    	$output.= 'if ( !class_exists( 'Styles_Child_Notices' ) ) {' . "\n";
    	$output.= 'include dirname( __FILE__ ) . '/classes/styles-child-notices/styles-child-notices.php';' . "\n";
    	$output.= '}' . "\n";
    	$output.= '</textarea>';
    	return $output;
    }

    <?php echo admin_notice_theme( $output ); ?>

    Also, I think we need to make the docs a little better. Most people don’t realize this is basically an api to extend their theme. I’ve tried advocating it many times on stackexchange, but people will argue that it “Only works with a few themes”.

    By auto creating a child plugin people people will have an easier time of understanding what their doing and how to use this. We could also have an export option where users could download their “child plugin” based on the changes they made. I’ve noticed many people have had issues with loosing changes. This would help so they don’t have to manually do things every time.

    This plugin I would suggest you recommend, because it easily lets you restore your customizer options at any time.

    I think the docs are a must for the todo list. While the youtube video helps, I think there a ton of things themers would find helpful that are impossible to know about unless you search through the code. If you take http://kirki.org/ which is the other decent customizer plugin, it is very easy to figure out how to use the plugin api.

    For example, it’s nice to know there is an option to change the customize.json file, but without browsing all the code most people would never know there was a filter to do this:

    function override_styles_path( $json_files ) {
        $json_files[] = get_stylesheet_directory() . '/styles/customize.json';
        return $json_files;
    }
    add_filters( 'styles_json_files', 'override_styles_path');

    Additionally, It would be nice to be able to do this and not have to include a child plugin at, where the user could simply add styles.json to there theme and be done with it. The plugin could also check if customize.json was in the theme folder main path and if it was, not require a child plugin. Maybe this is already available, I just didn’t come across it.

    It would also be nice to define styles headers in theme styles.css instead of a seperate plugin (this also might work already haven’t tried though). Logically this makes more since to me, since the plugin is theme dependent anyway.

    Another nice one to add is option to remove the menu page, otherwise this is simple enough:

    function remove_styles_menu() {
        remove_submenu_page( 'options-general.php', 'settings_page_styles' );
    }
    add_action( 'admin_menu', 'remove_styles_menu', 999 );

    Most importantly 75,000 downloads and only 5 public themes available is terrible! People are either too selfish to share or like I said previously they need an easier way to upload. WordPress is mainly a community of designers and bloggers, and we need to make it easier for them! If we make it so they can auto create their plugin and all they have to do is create themes, you can include an upload button on your site that lets them share there theme. I think a lot more people would contribute if it were that easy.

    Anyway, these are all just ideas, let me know if you guys want me to add the auto plugin installer and I’ll write it next week when I get a chance. I also have a “twitter bootstap” theme I will add this weekend that and will allow them to use this a lot easier by using bootstrap.

    Also, heres a link on how to include this with tgm activation

    https://wordpress.org/plugins/styles/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author pdclark

    (@pdclark)

    Hi codecandid,

    You have a lot of good ideas in here. Some are already implemented, but not documented, while others have fallen by the wayside due to the nature of my creating this plugin as a hobby project in personal hours after my full-time job.

    I’ll address these as best I can in brief below. Many of them would be best created as Github issues so they can be tracked and discussed individually. I couldn’t find you on Twitter, but if you can follow me, I’d be happy to set up a time to discuss over video.

    In brief:

    Defaults (e.g., H1-H6)
    This is certainly a possibility. I’d be concerned about these options conflicting with unknown themes, or simply not working (and generating a slew of support tickets), but this might be avoided by setting !important, a higher-priority base selector, or simply notifying users of the trade-off.

    Plugins
    There are a few additional add-ons from The Stitz Media, but unfortunately, that developer chose to sell independently, rather than adding them to stylesplugin.com, which was my original hope for a location to distribute additional free or paid add-ons.

    I was working towards having a remote API for sharing additional themes through the WordPress admin. I’d still love to see that. Unfortunately, I ran out of steam (such an API is not a light undertaking!).

    Documentation

    The example video was my attempt at this, but as you know, it has fallen short for some users. I’d happily accept pull requests on Github to improve documentation.

    I’d also happy accept a pull request to add a reference to Settings Revisions, which is an excellent plugin. I’ve already worked with Weston to assure it works well with Styles.

    Inline plugin example, or automatic plugin creation
    I’d also accept a pull request here, although I would be a bit more strict about approach. For example, I’d want to see HTML output separated into it’s own view, and would require that variable output be validated for security.

    If an example plugin were automatically created, I’d require that it make use of the WP Filesystem API to avoid as many write issues as possible, and fallback to the above solution if write access to plugins was not available.

    Support within themes
    This is currently supported, but undocumented. Styles looks for customize.json in the theme directory and prioritizes it over any plugin-based theme support.

    Defining styles headers in styles.css shouldn’t be necessary with this — all the necessary information is available in customize.json.

    TGM Activation
    Because of the original intent to use a remote API, Styles currently attempts to resolve its own plugin dependencies. Ideally I’d just like to get back to an API, but because there are unexpected issues for some users with dependency detection, I would be open to discussing simplification or migration to TGM here. This is another one I would want to approach carefully, as there are lots of “gotchas” to consider. For example, parent themes vs. child themes.

    WordPress 4.0 issues
    Can you be more specific about issues you’re seeing?

    If possible, please respond to each of these as individual issues on Github. This is too many topics to track effectively in one thread, and wordpress.org is a less-than-effective forum for discussing development topics.

    Plugin Author pdclark

    (@pdclark)

    Oh, and also, removing the menu:

    I’m unclear on the advantage of adding an admin option to remove the menu — since once removed, a typical user would then not have a way to get it back! The approach you’ve taken with code seems best to me (and pretty standard for any plugin). If you want it to be shorter, this is possible in PHP 5:

    add_action( 'admin_menu', function(){ remove_submenu_page( 'options-general.php', 'settings_page_styles' ); }, 999 );
    Thread Starter Bryan Willis

    (@codecandid)

    Wow thanks for the great reply Paul, after I hit submit I saw how much I wrote and figured it probably wouldn’t even get read. You made some great points! I’ll submit a ticket later this week on github when I get a chance. Thanks again.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Easier Configuration Ideas’ is closed to new replies.