Changeset 3042247
- Timestamp:
- 02/28/2024 12:19:33 AM (2 years ago)
- Location:
- conversation-starter
- Files:
-
- 17 added
- 9 deleted
- 4 edited
-
assets/banner-1544x500.png (added)
-
assets/banner-772x250.png (modified) (previous)
-
assets/icon-128x128.gif (added)
-
assets/icon-256x256.gif (added)
-
assets/screenshot-1.png (added)
-
assets/screenshot-2.png (added)
-
trunk/PluginCore (deleted)
-
trunk/assets/css/admin.css (added)
-
trunk/assets/css/frontend.php (added)
-
trunk/assets/images/click-ranger-pro.svg (deleted)
-
trunk/assets/images/toggle.gif (added)
-
trunk/assets/js (added)
-
trunk/assets/js/admin.js (added)
-
trunk/assets/js/frontend.php (added)
-
trunk/gpl-3.0.txt (deleted)
-
trunk/images (deleted)
-
trunk/javascripts (deleted)
-
trunk/lib/changelog.php (deleted)
-
trunk/lib/class-admin.php (added)
-
trunk/lib/class-changelog.php (added)
-
trunk/lib/class-frontend.php (added)
-
trunk/lib/class-helpers.php (added)
-
trunk/lib/class-meta-box.php (added)
-
trunk/pj-convo.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/screenshot-1.png (deleted)
-
trunk/screenshot-2.png (deleted)
-
trunk/stylesheets (deleted)
-
trunk/views/changelog.php (modified) (4 diffs)
-
trunk/views/options.php (added)
Legend:
- Unmodified
- Added
- Removed
-
conversation-starter/trunk/pj-convo.php
r2020793 r3042247 1 1 <?php 2 /* 3 Plugin Name: Conversation Starter 4 Plugin URI: http://www.pixeljar.net/491/conversation-manager/ 5 Description: This plugin prompts readers to answer a question in your comments. 6 Author: brandondove, jeffreyzinn, STDestiny, vegasgeek, drewstrojny 7 Version: 1.3 8 Author URI: http://www.pixeljar.net 9 Text Domain: pj-convo 2 /** 3 * Plugin Name: Conversation Starter 4 * Plugin URI: https://www.pixeljar.com/wordpress-plugin-development/conversation-manager/ 5 * Description: This plugin prompts readers to answer a question in your comments. 6 * Version: 1.4 7 * Requires at least: 6.0 8 * Requires PHP: 7.4 9 * Author: Pixel Jar 10 * Author URI: https://www.pixeljar.com 11 * License: GPLv2 12 * License URI: https://www.gnu.org/licenses/gpl-2.0.html 13 * Text Domain: pj-convo 14 * Domain Path: /languages 10 15 11 This program is free software; you can redistribute it and/or modify12 it under the terms of the GNU General Public License as published by13 the Free Software Foundation; either version 2 of the License, or14 (at your option) any later version.16 * This program is free software; you can redistribute it and/or modify 17 * it under the terms of the GNU General Public License as published by 18 * the Free Software Foundation; either version 2 of the License, or 19 * (at your option) any later version. 15 20 16 This program is distributed in the hope that it will be useful,17 but WITHOUT ANY WARRANTY; without even the implied warranty of18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the19 GNU General Public License for more details.21 * This program is distributed in the hope that it will be useful, 22 * but WITHOUT ANY WARRANTY; without even the implied warranty of 23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 24 * GNU General Public License for more details. 20 25 21 You should have received a copy of the GNU General Public License 22 along with this program; if not, write to the Free Software 23 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 24 */ 26 * You should have received a copy of the GNU General Public License 27 * along with this program; if not, write to the Free Software 28 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 29 * 30 * @package PJ_Conversation_Starter 31 */ 25 32 26 if ( ! defined( 'WP_CONTENT_URL' ) ) 27 define( 'WP_CONTENT_URL', get_option( 'siteurl' ) . '/wp-content' ); 28 if ( ! defined( 'WP_CONTENT_DIR' ) ) 29 define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' ); 30 if ( ! defined( 'WP_PLUGIN_URL' ) ) 31 define( 'WP_PLUGIN_URL', WP_CONTENT_URL. '/plugins' ); 32 if ( ! defined( 'WP_PLUGIN_DIR' ) ) 33 define( 'WP_PLUGIN_DIR', WP_CONTENT_DIR . '/plugins' ); 34 if ( ! defined( 'CONVO_URL' ) ) 35 define( 'CONVO_URL', WP_PLUGIN_URL. '/conversation-starter' ); 36 if ( ! defined( 'CONVO_DIR' ) ) 37 define( 'CONVO_DIR', WP_PLUGIN_DIR . '/conversation-starter' ); 33 namespace PJ_Conversation_Starter; 38 34 39 define( 'CONVO_ASSETS', plugin_dir_url( __FILE__ ) . 'assets/' ); 40 define( 'CONVO_LIB', plugin_dir_path( __FILE__ ) . 'lib/' ); 41 define( 'CONVO_VERSION', '1.3' ); 35 define( 'PJ_CONVO_URL', plugin_dir_url( __FILE__ ) ); // Includes ending slash. 36 define( 'PJ_CONVO_PATH', plugin_dir_path( __FILE__ ) ); // Includes ending slash. 37 define( 'PJ_CONVO_ASSETS', PJ_CONVO_URL . 'assets/' ); 38 define( 'PJ_CONVO_LIB', PJ_CONVO_PATH . 'lib/' ); 39 define( 'PJ_CONVO_VERSION', '1.4' ); 42 40 43 if ( ! class_exists( 'PJ_Convo_Changelog' ) ) { 44 require_once CONVO_LIB . 'changelog.php'; 41 /** 42 * Load translations. 43 * 44 * @return void 45 */ 46 function pj_convo_load_textdomain() { 47 48 load_plugin_textdomain( 'pj-convo', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' ); 49 45 50 } 51 add_action( 'init', '\PJ_Conversation_Starter\pj_convo_load_textdomain' ); 46 52 47 function pj_convo_starter_add_model_meta() 48 { 49 add_meta_box( 'pj_convo_starter_metabox', __('Conversation Starter'), 'pj_convo_starter_metabox', 'post', 'normal', 'high' ); 50 } 51 52 function pj_convo_starter_metabox() 53 { 54 global $post; 55 56 $promptext = get_post_meta($post->ID, 'prompt', true); 57 58 if (empty($promptext)) { 59 global $convo_starter; 60 $promptext = $convo_starter->defaultPromptText(); // "What do you think about this post?"; 61 } 62 63 ?> 64 <label for="promptext"><?php echo __("Use this text to prompt the readers:" ); ?></label><br /> 65 <textarea rows="5" cols="35" name="promptext" id="promptext"><?php echo $promptext; ?></textarea><br /> 66 67 <?php 68 } 69 70 function pj_convo_starter_save_model_meta($post_id, $post) 71 { 72 // Is the user allowed to edit the post or page? 73 if ( isset( $_POST['post_type'] ) && 'page' === $_POST['post_type'] ) { 74 if ( !current_user_can( 'edit_page', $post->ID )) 75 return $post->ID; 76 } else { 77 if ( !current_user_can( 'edit_post', $post->ID )) 78 return $post->ID; 79 } 80 81 $mydata['prompt'] = ''; 82 if ( isset( $_POST['promptext'] ) ) { 83 $mydata['prompt'] = $_POST['promptext']; 84 } 85 86 foreach ($mydata as $key => $value) { //Let's cycle through the $mydata array! 87 if( $post->post_type == 'revision' ) return; //don't store custom data twice 88 $value = implode(',', (array)$value); //if $value is an array, make it a CSV (unlikely) 89 if(get_post_meta($post->ID, $key, FALSE)) { //if the custom field already has a value 90 update_post_meta($post->ID, $key, $value); 91 } else { //if the custom field doesn't have a value 92 add_post_meta($post->ID, $key, $value); 93 } 94 if(!$value) delete_post_meta($post->ID, $key); //delete if blank 95 } 96 } 97 98 /* Use the admin_menu action to define the custom boxes */ 99 add_action('admin_menu', 'pj_convo_starter_add_model_meta'); 100 add_action('save_post', 'pj_convo_starter_save_model_meta', 1, 2); 101 add_action('activate_conversation-starter/pj-convo.php', array(&$convo_starter, 'activateMe')); 102 add_action('wp_head', 'pj_convo_starter_head_intercept'); 103 add_action('wp_footer', 'pj_convo_starter_foot_intercept'); 104 function pj_convo_starter_head_intercept() 105 { 106 echo '<meta name="generator" content="Think-Press, Conversation Starter v1.1" />'; 107 } 108 function pj_convo_starter_foot_intercept () 109 { 110 global $post; 111 echo '<script language="javascript" src="'.get_option('home').'/index.php?conversation-starter=frontend_js&convo-id='.$post->ID.'"></script>'; 112 } 113 114 115 /*---------------------------- 116 FRONTEND CSS & JS files 117 */ 118 function pj_convo_parse_request($wp) { 119 // only process requests with "my-plugin=ajax-handler" 120 if (array_key_exists('conversation-starter', $wp->query_vars) 121 && $wp->query_vars['conversation-starter'] == 'frontend_css') { 122 include(CONVO_DIR.'/stylesheets/frontend.php'); 123 die(); 124 } else if (array_key_exists('conversation-starter', $wp->query_vars) 125 && $wp->query_vars['conversation-starter'] == 'frontend_js') { 126 include(CONVO_DIR.'/javascripts/frontend.php'); 127 die(); 128 } 129 } 130 add_action('wp', 'pj_convo_parse_request'); 131 132 function pj_convo_query_vars($vars) { 133 $vars[] = 'conversation-starter'; 134 $vars[] = 'convo-id'; 135 return $vars; 136 } 137 add_filter('query_vars', 'pj_convo_query_vars'); 138 139 140 141 /*---------------------------- 142 ADMIN Page functionality 143 */ 144 require ('PluginCore/extend.php'); 145 146 ?> 53 require_once PJ_CONVO_LIB . 'class-helpers.php'; 54 require_once PJ_CONVO_LIB . 'class-admin.php'; 55 require_once PJ_CONVO_LIB . 'class-meta-box.php'; 56 require_once PJ_CONVO_LIB . 'class-frontend.php'; 57 require_once PJ_CONVO_LIB . 'class-changelog.php'; -
conversation-starter/trunk/readme.txt
r2020793 r3042247 1 1 === Conversation Starter === 2 Contributors: brandondove, jeffreyzinn, STDestiny, vegasgeek, drewstrojny , nateconley2 Contributors: brandondove, jeffreyzinn, STDestiny, vegasgeek, drewstrojny 3 3 Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=9525411 4 Tags: conversation, comments 5 Requires at least: 4.8 6 Tested up to: 5.0.3 7 Stable tag: 1.3 4 Tags: conversation, blog, comments 5 Requires at least: 6.0 6 Tested up to: 6.5 7 Stable tag: 1.4 8 Requires PHP: 7.4 9 License: GPLv2 or later 10 License URI: https://www.gnu.org/licenses/gpl-2.0.html 8 11 9 12 == Description == … … 24 27 = I installed the plugin, but nothing happened. = 25 28 26 We didn't want to assume you wanted to prompt your users to say anything on every post, so we only put the prompts on posts where you've specifically entered a prompt. G Ointo the post edit screen and add prompts for users as you see fit.29 We didn't want to assume you wanted to prompt your users to say anything on every post, so we only put the prompts on posts where you've specifically entered a prompt. Go into the post edit screen and add prompts for users as you see fit. 27 30 28 31 == Screenshots == -
conversation-starter/trunk/views/changelog.php
r2020793 r3042247 1 <?php 2 /** 3 * Changelog view. 4 * 5 * @package Conversation_Starter 6 */ 7 8 ?> 9 1 10 <div class="wrap"> 2 <h1><?php esc_html_e( 'Conversation Starter Changelog', 'pj-convo' ); ?></h1> 11 <h1>Conversation Starter - Changelog</h1> 12 13 <h3>1.4</h3> 14 <ul> 15 <li>This version represents a major modernization of the codebase</li> 16 <li>Updated to work with WordPress 6.5</li> 17 <li>Updated to work with PHP 8</li> 18 <li>This version implements standard security practices</li> 19 </ul> 3 20 4 21 <h3>1.3</h3> … … 10 27 <h3>1.2</h3> 11 28 <ul> 12 <li> <?php esc_html_e( 'Fixed cases when incorrect prompt would show up above the comment form.', 'pj-convo' ); ?></li>13 <li> <?php esc_html_e( 'Fixed several escaping functions that led to data being placed in incorrect places.', 'pj-convo' ); ?></li>29 <li>Fixed cases when incorrect prompt would show up above the comment form.</li> 30 <li>Fixed several escaping functions that led to data being placed in incorrect places.</li> 14 31 </ul> 15 32 16 33 <h3>1.1.1</h3> 17 34 <ul> 18 <li> <?php esc_html_e( 'Stopped the box from showing up when no message was defined for a post (posts written before the plugin was installed)', 'pj-convo' ); ?></li>35 <li>Stopped the box from showing up when no message was defined for a post (posts written before the plugin was installed)</li> 19 36 </ul> 20 37 21 38 <h3>1.1</h3> 22 39 <ul> 23 <li> <?php esc_html_e( 'The security holes have been patched up.', 'pj-convo' ); ?></li>24 <li> <?php esc_html_e( 'Reworked how the prompt was attached to the comment form to allow for greater compatibility with more themes.', 'pj-convo' ); ?></li>40 <li>The security holes have been patched up.</li> 41 <li>Reworked how the prompt was attached to the comment form to allow for greater compatibility with more themes.</li> 25 42 </ul> 26 43 27 44 <h3>1.0</h3> 28 45 <ul> 29 <li> <?php esc_html_e( 'It\'s version 1 baby, what you see is what you get.', 'pj-convo' ); ?></li>46 <li>It's version 1 baby, what you see is what you get.</li> 30 47 </ul> 31 48 32 49 <div class="pixel-jar-ads"> 33 <h3> <?php esc_html_e( 'More from Pixel Jar', 'pj-convo' ); ?></h3>50 <h3>More from Pixel Jar</h3> 34 51 35 52 <div class="ad-flex-container"> … … 37 54 <a href="https://www.pixeljar.com/" target="_blank"> 38 55 <img 39 src="<?php echo CONVO_ASSETS . 'images/pixel-jar.svg' ?>"40 alt=" <?php esc_attr_e( 'Pixel Jar logo', 'pj-convo' ); ?>"56 src="<?php echo esc_url( PJ_CONVO_ASSETS . 'images/pixel-jar.svg' ); ?>" 57 alt="Pixel Jar logo" 41 58 /> 42 59 </a> 43 <p><?php 44 printf( 45 wp_kses( 46 __( 'Conversation Starter is proudly powered by %1$s. We’re a small web development agency that focuses on %2$s as a development platform for websites. %1$s started in 2004. It grew out of the desire to be free to choose projects that challenge us and work with clients that inspire us. Read more about us <a href="%3$s" target="_blank">here</a>.', 'pj-convo' ), 47 array( 'a' => array( 48 'href' => array(), 49 'target' => array(), 50 ) ) 51 ), 52 'Pixel Jar', 53 'WordPress', 54 esc_url( 'https://www.pixeljar.com' ) 55 ); 56 ?></p> 60 <p>Conversation Starter is proudly powered by Pixel Jar. We're a small web development agency that focuses on WordPress as a development platform for websites. Pixel Jar started in 2004. It grew out of the desire to be free to choose projects that challenge us and work with clients that inspire us. Read more about us <a href="https://pixeljar.com" target="_blank">here</a></p> 57 61 </div> 58 62 … … 60 64 <a href="https://adsanityplugin.com/" target="_blank"> 61 65 <img 62 src="<?php echo CONVO_ASSETS . 'images/adsanity.svg' ?>"63 alt=" <?php esc_attr_e( 'AdSanity logo', 'pj-convo' ); ?>"66 src="<?php echo esc_url( PJ_CONVO_ASSETS . 'images/adsanity.svg' ); ?>" 67 alt="AdSanity logo" 64 68 /> 65 69 </a> 66 <p><?php 67 printf( 68 wp_kses( 69 __( '%1$s also makes %2$s, a light ad rotator plugin for %3$s. It allows the user to create and manage ads shown on a website as well as keep statistics on views and clicks through a robust set of features. You can read all about it on the <a href="%4$s" target="_blank">%2$s site</a>.', 'pj-convo' ), 70 array( 'a' => array( 71 'href' => array(), 72 'target' => array(), 73 ) ) 74 ), 75 'Pixel Jar', 76 'AdSanity', 77 'WordPress', 78 esc_url( 'https://adsanityplugin.com/' ) 79 ); 80 ?></p> 81 </div> 82 83 <div class="ad"> 84 <a href="https://www.clickrangerpro.com/" target="_blank"> 85 <img 86 src="<?php echo CONVO_ASSETS . 'images/click-ranger-pro.svg' ?>" 87 alt="<?php esc_attr_e( 'Click Ranger Pro logo', 'pj-convo' ); ?>" 88 /> 89 </a> 90 <p><?php 91 printf( 92 wp_kses( 93 __( '%1$s helps you easily track user clicks, downloads, and events of your %2$s website to %3$s. Get the data you need without the fuss of JavaScript or PHP. You can read all about it on the <a href="%4$s" target="_blank">%1$s site</a>.', 'pj-convo' ), 94 array( 'a' => array( 95 'href' => array(), 96 'target' => array(), 97 ) ) 98 ), 99 'Click Ranger Pro', 100 'WordPress', 101 'Google Analytics', 102 esc_url( 'https://www.clickrangerpro.com/' ) 103 ); 104 ?></p> 70 <p>Pixel Jar also makes AdSanity, a light ad rotator plugin for WordPress. It allows the user to create and manage ads shown on a website as well as keep statistics on views and clicks through a robust set of features. You can read all about it on the <a href="https://adsanityplugin.com" target="_blank">AdSanity site</a>.</p> 105 71 </div> 106 72 </div>
Note: See TracChangeset
for help on using the changeset viewer.