Plugin Directory

Changeset 1339585


Ignore:
Timestamp:
01/30/2016 11:06:17 AM (10 years ago)
Author:
liam_bowers
Message:

Merged 0.3 in to trunk

Location:
wp2jekyll/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • wp2jekyll/trunk

  • wp2jekyll/trunk/inc/admin.php

    r1339383 r1339585  
    1212function wordpress2jekyll_admin_menu(  ) {
    1313
    14     add_options_page('Wordpress2Jekyll',   'Wordpress2Jekyll', 'manage_options',   'wordpress2jekyll', 'wordpress2jekyll_options_page');
     14    add_options_page('WordPress2Jekyll',   'WordPress2Jekyll', 'manage_options',   'wordpress2jekyll', 'wordpress2jekyll_options_page');
    1515
    1616    add_submenu_page('tools.php',           'Build',           'Jekyll',            'administrator',    'wordpress2jekyll-build',         'wordpress2jekyll_build_page',          'dashicons-migrate');
     
    338338function wordpress2jekyll_verify_jekyll_path($value)
    339339{
     340    $value = trim($value);
     341
     342    if(empty($value))
     343    {
     344        add_settings_error(
     345            'jekyll_path',
     346            esc_attr( 'settings_updated' ),
     347            'The Jekyll path can not be empty',
     348            'error'
     349        );
     350
     351        return false;
     352    }
     353
    340354    $jekyll = new \jekyll();
    341355
     
    366380function wordpress2jekyll_verify_assets_directory($value)
    367381{
     382    $value = trim($value);
     383
     384    if(empty($value))
     385    {
     386        add_settings_error(
     387            'jekyll_assets_directory',
     388            esc_attr( 'settings_updated' ),
     389            'The assets directory can not be empty',
     390            'error'
     391        );
     392
     393        return false;
     394    }
     395
    368396    $jekyll = new \jekyll();
    369397
     
    399427function wordpress2jekyll_verify_data_directory($value)
    400428{
     429    $value = trim($value);
     430
     431    if(empty($value))
     432    {
     433        add_settings_error(
     434            'jekyll_data_directory',
     435            esc_attr( 'settings_updated' ),
     436            'The data directory can not be empty',
     437            'error'
     438        );
     439
     440        return false;
     441    }
     442
    401443    $jekyll = new \jekyll();
    402444
     
    432474function wordpress2jekyll_verify_posts_directory($value)
    433475{
     476    $value = trim($value);
     477
     478    if(empty($value))
     479    {
     480        add_settings_error(
     481            'jekyll_posts_directory',
     482            esc_attr( 'settings_updated' ),
     483            'The posts directory can not be empty',
     484            'error'
     485        );
     486
     487        return false;
     488    }
     489
    434490    $jekyll = new \jekyll();
    435491
     
    493549    ?>
    494550    <div class="wrap">
    495         <h2><?php _e('Wordpress2Jekyll Build', 'wordpress2jekyll') ?></h2>
     551        <h2><?php _e('WordPress2Jekyll Build', 'wordpress2jekyll') ?></h2>
    496552
    497553        <form method="post" action="admin.php?page=wordpress2jekyll-build">
    498             <p>Export all Wordpress posts and authors in to the Jekyll directory.</p>
     554            <p>Export all WordPress posts and authors in to the Jekyll directory.</p>
    499555
    500556            <?php submit_button('Export', 'primary', 'export'); ?>
  • wp2jekyll/trunk/inc/hooks.php

    r1339383 r1339585  
    66}
    77
    8 register_activation_hook(__FILE__, 'wordpress2jekyll_activate');
    98add_action('save_post',         'wordpress2jekyll_write_post');
    109add_action('post_updated',      'wordpress2jekyll_update_post', 10, 3);
     
    1716
    1817add_action('edit_terms', 'wordpress2jekyll_taxonomy_update', 10, 2);
    19 
    20 function wordpress2jekyll_activate()
    21 {
    22     update_option('jekyll_path',                        '../_jekyll');
    23     update_option('jekyll_posts_directory',             '_posts');
    24     update_option('jekyll_assets_directory',            '_assets');
    25     update_option('jekyll_data_directory',              '_data');
    26     update_option('jekyll_enable_auto_build',           1);
    27     update_option('jekyll_save_pages',                  1);
    28     update_option('jekyll_use_wordpress_permalinks',    1);
    29     update_option('jekyll_wordpress_preprocess_content',1);
    30     update_option('jekyll_export_post_meta',            0);
    31     update_option('jekyll_export_users',                0);
    32     update_option('jekyll_export_taxonomies',           0);
    33     update_option('jekyll_taxonomies',                  array());
    34 }
    3518
    3619function wordpress2jekll_save_post($post_id)
  • wp2jekyll/trunk/readme.txt

    r1339409 r1339585  
    1 === Wordpress2Jekyll ===
     1=== WordPress2Jekyll ===
    22Contributors: liam_bowers
    33Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A5BPK7XBH54UY
    4 Tags: jekyll, export, flat, blog
     4Tags: jekyll, export, flat, blog, github, yaml
    55Requires at least: 4.3
    66Tested up to: 4.4.1
     
    99License URI: http://www.gnu.org/licenses/gpl-3.0.html
    1010
    11 This allows you to use Wordpress as an interface to Jekyll. It will save posts, taxonomies and author information out in a Jekyll friendly format.
     11This allows you to use WordPress as an interface to Jekyll. It will save posts, taxonomies and author information out in a Jekyll friendly format.
    1212
    1313== Description ==
     
    1515Jekyll is a great tool that will build a full blog site using text files written in a specific format. It gives you the bonus of having a very light and quick site that can't be hacked through script vulnerabilities. The downside of this is that it's not always easy to edit. It's harder still when using a mobile device.
    1616
    17 This is where Wordpress comes in. Wordpress can be used to modify the posts (both standard posts and pages) and these changes will automatically be exported. The same applies for taxonomies and users if desired. This means that it is possible to edit content using a mobile device and the Wordpress app.
     17This is where WordPress comes in. WordPress can be used to modify the posts (both standard posts and pages) and these changes will automatically be exported. The same applies for taxonomies and users if desired. This means that it is possible to edit content using a mobile device and the WordPress app.
    1818
    19 Wordpress2Jekyll attempts to marry these two systems together in order to make a quick, secure website that can be easily managed from all devices.
     19WordPress2Jekyll attempts to marry these two systems together in order to make a quick, secure website that can be easily managed from all devices.
    2020
    2121= What can it do? =
     
    2424* Converts page content to Markdown format (assumes it is HTML).
    2525* Has option to use the Wordpress Permalinks patterns rather than using the configured Jekyll method.
    26 * Ability to allow Wordpress to run content through the_content filter to allow plugins to interact with the body content.
     26* Ability to allow WordPress to run content through the_content filter to allow plugins to interact with the body content.
    2727* Automatically builds individual pages (or full build) depending on what has changed in the post.
    2828* Configurable assets, data and posts directories.
     
    38381. Upload the plugin files to the `/wp-content/plugins/wp2jekyll` directory, or install the plugin through the WordPress plugins screen directly.
    39391. Activate the plugin through the 'Plugins' screen in WordPress.
    40 1. Use the Settings->Wordpress2Jekyll screen to configure the plugin. This Jekyll path must point to an existing Jekyll site directory. If you're using it for testing purposes then make sure the assets, data and posts directories exist. It will complain if it doesn't find them.
     401. Use the Settings->WordPress2Jekyll screen to configure the plugin. This Jekyll path must point to an existing Jekyll site directory. If you're using it for testing purposes then make sure the assets, data and posts directories exist. It will complain if it doesn't find them.
    41411. Use Tools->Jekyll to perform a full export of the current content as defined in the settings.
    4242
     
    7070== Changelog ==
    7171
     72= 0.3 =
     73
     74* Fixed issue relating to the default settings not being set correctly after plugin activation or upgrade.
     75* Fixed an issue regarding the check for Jekyll returning a false positive.
     76
     77= 0.2.1 =
     78
     79Fixing versioning issue.
     80
    7281= 0.2 =
    7382
     
    8897== Limitations ==
    8998
    90 * This plugin assumes that all Jekyll posts are stored in Wordpress and any files in the posts directory can be deleted. This is a necessary for maintenance.
     99* This plugin assumes that all Jekyll posts are stored in WordPress and any files in the posts directory can be deleted. This is a necessary for maintenance.
    91100* Featured images will be exported and linked accordingly.
    92101* Doesn't support password protected posts at this time (I'm not sure if it ever will).
     
    94103* Supports categories (exported in order)
    95104* Supports tags (exported in order)
    96 * Ideally the Wordpress installation should be hidden away and not publicly accessible. I'm working on a separate plugin to do this easily.
     105* Ideally the WordPress installation should be hidden away and not publicly accessible. I'm working on a separate plugin to do this easily.
    97106
    98107== Wishlist ==
  • wp2jekyll/trunk/wordpress2jekyll.php

    r1339409 r1339585  
    11<?php
    22/*
    3 Plugin Name: Wordpress2Jekyll
     3Plugin Name: WordPress2Jekyll
    44Plugin URI:  https://wordpress.org/plugins/wp2jekyll/
    55Description: This allows you to use WordPress as an interface to Jekyll. It will save posts, taxonomies and author information out in a Jekyll friendly format.
    6 Version:     0.2.1
     6Version:     0.3
    77Author:      Liam Bowers
    88Author URI:  http://liam.pw
     
    1212if ( ! defined( 'WPINC' ) ){
    1313    die;
     14}
     15
     16//Activation hook
     17
     18register_activation_hook(__FILE__, 'wordpress2jekyll_activate');
     19
     20function wordpress2jekyll_activate()
     21{
     22    update_option('jekyll_path',                        '../_jekyll');
     23    update_option('jekyll_posts_directory',             '_posts');
     24    update_option('jekyll_assets_directory',            '_assets');
     25    update_option('jekyll_data_directory',              '_data');
     26    update_option('jekyll_enable_auto_build',           0);
     27    update_option('jekyll_save_pages',                  0);
     28    update_option('jekyll_use_wordpress_permalinks',    1);
     29    update_option('jekyll_wordpress_preprocess_content',1);
     30    update_option('jekyll_export_post_meta',            0);
     31    update_option('jekyll_export_users',                0);
     32    update_option('jekyll_export_taxonomies',           0);
     33    update_option('jekyll_taxonomies',                  array());
    1434}
    1535
     
    2646            echo wp_kses_post( __( '<b>Wordpress2Jekyll</b> requires PHP 5.3 or higher, and the plugin has now disabled itself.', 'wordpress2jekyll' ) ) .
    2747                '<br />' .
    28                 esc_attr__( 'To allow better control over dates, advanced security improvements and performance gain.', 'wordpress2jekyll' ) .
    29                 '<br />' .
    3048                esc_attr__( 'Contact your Hosting or your system administrator and ask for this Upgrade to version 5.3 of PHP.', 'wordpress2jekyll' );
    3149            exit();
Note: See TracChangeset for help on using the changeset viewer.