Commit 29d688d7 authored by Canek Peláez's avatar Canek Peláez
Browse files

Stupid WP registry.

parent d69c9563
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -3,13 +3,13 @@ $wc_chart_title = '';
switch ($post_type) {
case 'post':
    $wc_chart_title = ($dt_unit == 'year') ?
        __("Words in posts by year", 'word-count') :
    __("Words in posts by month", 'word-count');
        __("Words in posts by year", 'free-word-count') :
    __("Words in posts by month", 'free-word-count');
    break;
case 'page':
    $wc_chart_title = ($dt_unit == 'year') ?
        __("Words in pages by year", 'word-count') :
    __("Words in pages by month", 'word-count');
        __("Words in pages by year", 'free-word-count') :
    __("Words in pages by month", 'free-word-count');
    break;
}
?>
@@ -47,7 +47,7 @@ case 'page':
                          pan: 'Panning',
                          reset: 'Reset Zoom',
                      }
                  }", 'word-count'); ?>,
                  }", 'free-word-count'); ?>,
              }],
              defaultLocale: '<?php echo (substr(get_locale(), 0, 2)); ?>'
          },
+9 −9
Original line number Diff line number Diff line
<?php
/**
 * @package Word_Count
 * @package Free_Word_Count
 * @version 0.0.1
 */
/*
Plugin Name: Word Count
Plugin URI: https://aztlan.fciencias.unam.mx/gitlab/canek/word-count/
Description: This plugin allows count words in posts and prode reports.
Plugin Name: Free Word Count
Plugin URI: https://aztlan.fciencias.unam.mx/gitlab/canek/free-word-count/
Description: This FREE plugin allows count words in posts and produce reports.
Author: Canek Peláez
Version: 0.0.1
Author URI: https://aztlan.fciencias.unam.mx/~canek/
Text Domain: word-count
Text Domain: free-word-count
*/

define('WORD_COUNT__PLUGIN_DIR', plugin_dir_path(__FILE__));

add_action('admin_menu', 'wc_admin_menu');
function wc_admin_menu() {
    add_menu_page(__('Word count and statistics for posts and pages', 'word-count'),
                  __('Word count', 'word-count'), 'manage_options', 'word-count',
    add_menu_page(__('Word count and statistics for posts and pages', 'free-word-count'),
                  __('Word count', 'free-word-count'), 'manage_options', 'free-word-count',
                  'word_count_page', 'dashicons-analytics', 90);
}

@@ -33,7 +33,7 @@ function wc_save_post($post_id) {
    }
    $text = strip_tags($post->post_content);
    $wc = str_word_count($text);
    update_post_meta($post_id, 'word-count', $wc);
    update_post_meta($post_id, 'free-word-count', $wc);
}

function word_count_page() {
@@ -67,5 +67,5 @@ function wc_activation($network_wide) {

add_action('plugins_loaded', 'wc_load_textdomain');
function wc_load_textdomain() {
    load_plugin_textdomain('word-count');
    load_plugin_textdomain('free-word-count');
}
+0 −0

File moved.

+6 −6
Original line number Diff line number Diff line
@@ -34,10 +34,10 @@ function echoPage($type, $page, $current, $sep = ' | ', $filter = '') {
}

function tab_headers($taburl = '', $selected = 'stats') {
    $tab_stats = __('Statistics', 'word-count');
    $tab_tables = __('Tables', 'word-count');
    $tab_barcharts = __('Bar charts', 'word-count');
    $tab_piecharts = __('Pie charts', 'word-count');
    $tab_stats = __('Statistics', 'free-word-count');
    $tab_tables = __('Tables', 'free-word-count');
    $tab_barcharts = __('Bar charts', 'free-word-count');
    $tab_piecharts = __('Pie charts', 'free-word-count');
    $sel_st = $sel_ta = $sel_bc = $sel_pc = '';
    switch ($selected) {
    case 'stats':     $sel_st = 'selected'; break;
@@ -62,7 +62,7 @@ function tab_headers($taburl = '', $selected = 'stats') {
}

function count_again_button() {
    $value = __('Count again', 'word-count');
    $value = __('Count again', 'free-word-count');
    echo "<p class=\"submit\">";
    echo "<input type=\"submit\" name=\"Recount\" " .
        "class=\"button\" value=\"$value\" />";
@@ -144,7 +144,7 @@ let wc = new WordCounter("<?php echo get_site_url(); ?>",
wc.launchInterval();
</script>
<div class="progress-container">
  <h2><?php _e("Word counting in progress:", 'word-count'); ?></h2>
  <h2><?php _e("Word counting in progress:", 'free-word-count'); ?></h2>
  <progress id="wc-progress" value="0" max="100">0%</progress>
</div>
<?php
+2 −2
Original line number Diff line number Diff line
@@ -10,7 +10,7 @@ $sql = $wpdb->prepare("
    FROM {$wpdb->posts}, {$wpdb->postmeta}
    WHERE {$wpdb->posts}.id = {$wpdb->postmeta}.post_id AND
          {$wpdb->posts}.post_status = 'publish' AND
          {$wpdb->postmeta}.meta_key = 'word-count' AND
          {$wpdb->postmeta}.meta_key = 'free-word-count' AND
          {$wpdb->posts}.post_type = %s
    ORDER BY post_date", $post_type);
$results = $wpdb->get_results($sql);
@@ -48,7 +48,7 @@ foreach ($results as $result) {
      'return year + "/" + (("00" + month).slice(-2));';
  include WORD_COUNT__PLUGIN_DIR . '/datetime-chart.php';
  $total_words_label = ($post_type == 'post') ?
      __('Total post words:', 'word-count') : __('Total page words:', 'word-count');
      __('Total post words:', 'free-word-count') : __('Total page words:', 'free-word-count');
?>
  </div>
  <p>
Loading