Plugin Directory

Changeset 2966945


Ignore:
Timestamp:
09/14/2023 09:43:11 AM (3 years ago)
Author:
ryanhellyer
Message:

Composer support

Location:
unique-headers
Files:
28 added
2 edited

Legend:

Unmodified
Added
Removed
  • unique-headers/trunk/index.php

    r2798946 r2966945  
    11<?php
    22/*
    3 Plugin Name: Unique Headers
    4 Plugin URI: https://geek.hellyer.kiwi/plugins/unique-headers/
    5 Description: Unique Headers
    6 Version: 1.8.2
     3Plugin Name: Spam Destroyer
     4Plugin URI: https://geek.hellyer.kiwi/products/spam-destroyer/
     5Description: Kills spam dead in it's tracks
    76Author: Ryan Hellyer
     7Version: 2.1.4
    88Author URI: https://geek.hellyer.kiwi/
    9 Text Domain: unique-headers
    10 License: GPL2
    119
    12 ------------------------------------------------------------------------
    13 Copyright Ryan Hellyer
     10Copyright (c) 2012 - 2019 Ryan Hellyer
     11
     12
     13Based on the following open source projects:
     14
     15Cookies for Comments by Donncha O Caoimh
     16http://ocaoimh.ie/cookies-for-comments/
     17
     18WP Hashcash by Elliot Back
     19http://wordpress-plugins.feifei.us/hashcash/
     20
     21Spam Catharsis by Brian Layman
     22http://TheCodeCave.com/plugins/spam-catharsis/
     23
     24Script para la generación de CAPTCHAS by Jose Rodrigueze
     25http://code.google.com/p/cool-php-captcha
     26
    1427
    1528This program is free software; you can redistribute it and/or modify
    16 it under the terms of the GNU General Public License as published by
    17 the Free Software Foundation; either version 2 of the License, or
    18 (at your option) any later version.
     29it under the terms of the GNU General Public License version 2 as
     30published by the Free Software Foundation.
    1931
    2032This program is distributed in the hope that it will be useful,
    2133but WITHOUT ANY WARRANTY; without even the implied warranty of
    2234MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    23 GNU General Public License for more details.
    24 
    25 You should have received a copy of the GNU General Public License
    26 along with this program; if not, write to the Free Software
    27 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
     35license.txt file included with this plugin for more information.
    2836
    2937*/
    30 
    3138
    3239/**
    3340 * Do not continue processing since file was called directly
    3441 *
    35  * @since 1.0
     42 * @since 2.0.7
    3643 * @author Ryan Hellyer <ryanhellyer@gmail.com>
    3744 */
     
    4047}
    4148
     49// Defining folder locations
     50define( 'SPAM_DESTROYER_DIR', dirname( __FILE__ ) );
     51define( 'SPAM_DESTROYER_URL', plugin_dir_url( __FILE__ ) );
    4252
    43 /**
    44  * Autoload the classes.
    45  * Includes the classes, and automatically instantiates them via spl_autoload_register().
    46  *
    47  * @param  string  $class  The class being instantiated
    48  */
    49 function autoload_unique_headers( $class ) {
     53// Load the bare minimum for the front-end
     54require( 'inc/class-spam-destroyer.php' );
    5055
    51     // Bail out if not loading a Media Manager class
    52     if ( 'Unique_Headers_' != substr( $class, 0, 15 ) ) {
    53         return;
    54     }
     56// Load extra modules - provides extra protection when required
     57require( 'inc/class-spam-destroyer-add-meta.php' );
     58require( 'inc/class-spam-destroyer-stats.php' );
    5559
    56     // Convert from the class name, to the classes file name
    57     $file_data = strtolower( $class );
    58     $file_data = str_replace( '_', '-', $file_data );
    59     $file_name = 'class-' . $file_data . '.php';
     60// Only load generate CAPTCHA class if appropriate GET request sent
     61if ( isset( $_GET['captcha'] ) ) {
     62    require( 'inc/class-spam-destroyer-generate-captcha.php' );
     63}
    6064
    61     // Get the classes file path
    62     $dir = dirname( __FILE__ );
    63     $path = $dir . '/inc/' . $file_name;
     65// Load admin panel only files
     66if ( is_admin() ) {
    6467
    65     // Include the class (spl_autoload_register will automatically instantiate it for us)
    66     require( $path );
     68    require( 'inc/class-spam-destroyer-settings.php' );
     69
     70    // Loading dotorg plugin review code
     71    require( 'inc/class-dotorg-plugin-review.php' );
     72    new DotOrg_Plugin_Review(
     73        array(
     74            'slug'        => 'spam-destroyer', // The plugin slug
     75            'name'        => 'Spam Destroyer', // The plugin name
     76            'time_limit'  => WEEK_IN_SECONDS,  // The time limit at which notice is shown
     77        )
     78    );
     79
    6780}
    68 spl_autoload_register( 'autoload_unique_headers' );
    69 
    70 new Unique_Headers_Instantiate;
  • unique-headers/trunk/readme.txt

    r2798946 r2966945  
    1 === Unique Headers ===
    2 Contributors: ryanhellyer
    3 Tags: custom-header, header, headers, images, page, post, plugin, image, images, categories, gallery, media, header-image, header-images, taxonomy, tag, category, posts, pages, taxonomies, post, page, unique, custom
    4 Donate link: https://geek.hellyer.kiwi/donate/
    5 Requires at least: 4.3
    6 Tested up to: 6.1
    7 Stable tag: 1.8.2
     1=== Spam Destroyer ===
     2Contributors: ryanhellyer, bjornjohansen, dimadin, brianlayman
     3Donate link: https://geek.hellyer.kiwi/products/spam-destroyer/
     4Tags: spam, comments, anti-spam, antispam, buddypress, bbpress, kill, destroy, eliminate, registration, register, registrate, captcha
     5Requires at least: 5.0
     6Tested up to: 6.4
     7Stable tag: 2.1.4
     8Text Domain: spam-destroyer
     9License: GPLv2 or later
     10License URI: http://www.gnu.org/licenses/gpl-2.0.html
    811
    912
    10 
    11 Adds the ability to use unique custom header images on individual pages, posts or categories or tags.
     13Kills spam dead in it's tracks. Be gone evil demon spam!
    1214
    1315== Description ==
    1416
    15 = Features =
    16 The <a href="https://geek.hellyer.kiwi/products/unique-headers/">Unique Headers Plugin</a> adds a custom header image box to the post/page edit screen. You can use this to upload a unique header image for that post, or use another image from your WordPress media library. When you view that page on the front-end of your site, the default header image for your site will be replaced by the unique header you selected.
    17 
    18 This functionality also works with categories and tags.
    19 
    20 = Requirements =
    21 You must use a theme which utilizes the built-in custom header functionality of WordPress. If your theme implement it's own header functionality, then this plugin will not work with it.
    22 
    23 = Paid WordPress development =
    24 If you would like to pay for assistance, additional features to be added to the plugin or are just looking for general WordPress development services, please contact me via <a href="https://ryan.hellyer.kiwi/contact/">my contact form</a>.
     17Stops automated spam while remaining as unobtrusive as possible to regular commenters. <a href="https://geek.hellyer.kiwi/products/spam-destroyer/">The Spam Destroyer plugin</a> is intended to be effortless to use. Simply install, and enjoy a spam free website :)
    2518
    2619
    2720== Installation ==
    2821
    29 After you've downloaded and extracted the files:
     22Simply install and activate the plugin. No settings necessary.
    3023
    31 1. Upload the complete 'unique-headers' folder to the '/wp-content/plugins/' directory OR install via the plugin installer
    32 2. Activate the plugin through the 'Plugins' menu in WordPress
    33 4. And yer done!
    34 
    35 Now you will see a new custom header image uploader whilst editing posts, pages, tags or categories on your site.
    36 
    37 Visit the <a href="https://geek.hellyer.kiwi/products/unique-headers/">Unique Headers Plugin</a> for more information.
     24For more information, visit the <a href="https://geek.hellyer.kiwi/products/spam-destroyer/">Spam Destroyer plugin page</a>.
    3825
    3926
    4027== Frequently Asked Questions ==
    4128
    42 = I upgraded to WordPress 4.4 and the taxonomy meta plugin broke. What should I do? =
    43 Older versions of WordPress required the taxonomy meta data plugin to add support for categories and tags. However, that functionality was rolled into the core of WordPress 4.4 and the old plugin stopped working with no upgrade path. You can simply delete the plugin, and your site will behave as normal, but the old header images for categories and tags will be missing. To work around this problem, please <a href="https://wordpress.org/support/topic/wordpress-44-fatal-error?replies=9#post-7762404">follow the instructions in this helpful support thread</a> for that plugin. Please note that I am not connected with the taxonomy meta data plugin and can not provide any assistance with it.
     29Check out the FAQ on the <a href="https://geek.hellyer.kiwi/products/spam-destroyer/">Spam Destroyer plugin</a> page.
    4430
    45 = I set a category header image, but why are my individual posts not showing that header image? =
    46 Setting a category (or other taxonomy) header image, only causes that header image to show on the category page itself. It does not make the header image show on the single posts of that category.
     31= Support =
     32If you would like to file a bug report or ask a question, please do so in the WordPress.org support forums.
    4733
    48 To add this functionality, please install the <a href="https://geek.hellyer.kiwi/plugins/unique-headers-single-posts/">Unique Headers single posts extension plugin</a>.
    49 
    50 = Your plugin doesn't work =
    51 Actually, it does work ;) The problem is likely with your theme. Some themes have "custom headers", but don't use the built-in WordPress custom header system and will not work with the Unique Headers plugin because of this. It is not possible to predict how other custom header systems work, and so those can not be supported by this plugin. To test if this is the problem, simply switch to one of the default themes which come with WordPress and see if the plugin works with those, if it does, then your theme is at fault.
    52 
    53 = My theme doesn't work with your plugin, how do I fix it? =
    54 This is a complex question and not something I can teach in a short FAQ. I recommend hiring a professional WordPress developer for assistance, or asking the developer of your theme to add support for the built-in WordPress custom header system.
    55 
    56 = Does it work with custom post-types? =
    57 
    58 Yes, as of version 1.5, support for publicly viewable custom post-types was added by default.
    59 
    60 = Does it work with taxonomies? =
    61 
    62 Yes, as of version 1.5 of the Unique Headers plugin and version 4.4 of WordPress, support for all publicly viewable custom taxonomies was added by default.
    63 
    64 
    65 = Where's the plugin settings page? =
    66 
    67 There isn't one.
    68 
    69 
    70 = Other plugins work out the width and height of the header and serve the correct sized header. Why doesn't your plugin do that? =
    71 
    72 I prefer to allow you to set the width and height yourself by opening a correct sized image. This allows you to provide over-resolution images to cater for "retina screen" and zoomed in users. Plus, it allows you to control the compression and image quality yourself. Neither route is better in my opinion. If you require this functionality, please let me know though, as if most people prefer the other route, then I may change how the plugin works. I suspect most people won't care either way though.
    73 
    74 
    75 = Does it work in older versions of WordPress? =
    76 
    77 Mostly, but I only actively support the latest version of WordPress. Support for older versions is purely by accident. Versions prior to 4.4 will definitely not work with categories and tags.
    78 
    79 
    80 = I need custom functionality. Can we pay you to build it for us? =
    81 
    82 Yes. Just send me a message via <a href="https://ryan.hellyer.kiwi/contact/">my contact form</a> with precise information about what you require.
    83 
    84 
    85 
    86 == Screenshots ==
    87 
    88 1. The new meta box as added to the posts/pages screen
    89 2. The custom header image uploader for adding new header images
    90 3. The new meta box for categories and tags.
     34= Who made the plugin? =
     35The original developer of the plugin was <a href="https://geek.hellyer.kiwi/">Ryan Hellyer</a>, but many others have contributed code to this project and are now listed as co-authors of the plugin.
    9136
    9237
    9338== Changelog ==
    9439
    95 = 1.8.2 =
    96 * Bug fix for when array value doesn't exist
     40= 2.1.4  (2023-09-14) =
     41* Confirmed support for newer WordPress versions
     42* Added Composer support
    9743
    98 = 1.8.1 =
    99 * Bug fix for offset value error
     44= 2.1.3  (2021-10-21) =
     45* Minor change to remove "out of date" notice on WordPress.org
    10046
    101 = 1.8 =
    102 * Bug fix for "WP_Scripts::localize was called" notice
     47= 2.1.3  (2019-04-19) =
     48* Minor change to remove "out of date" notice on WordPress.org
    10349
    104 = 1.7.12 =
    105 * Bug fix for when no object set in Unique_Headers_Taxonomy_Header_Images::modify_header_image_data()
     50= 2.1.2  (2019-03-07) =
     51* Fixing debbug notice in error returns
    10652
    107 = 1.7.11 =
    108 * Version bump to force dot org update
     53= 2.1.1  (2018-03-18) =
     54* Fixing bug in admin notice GD detection
    10955
    110 = 1.7.10 =
    111 * Correctly checking for presence of object before setting width and height
     56= 2.1.0  (2018-03-18) =
     57* Added prefix to cookie to provide less work for those trying to do cookie auditing
     58* Blocking comments when CAPTCHA is served but GD not enabled
     59* Providing notice to let the admin know that the CAPTCHA system is not working
     60* Providing option to disable the admin notice about CAPTCHA system not working
    11261
    113 = 1.7.9 =
    114 * Checking for presence of object before setting width and height
    115 
    116 = 1.7.8 =
    117 * Fixing filter bug
    118 
    119 = 1.7.7 =
    120 * Fixing filter bug
    121 
    122 = 1.7.6 =
    123 * Fixing bug in taxonomy setup
    124 
    125 = 1.7.5 =
    126 * Fixing bug in taxonomy setup
    127 
    128 = 1.7.4 =
    129 * Fixing bug in taxonomy setup
    130 
    131 = 1.7.3 =
    132 * Bug fix for srcset with taxonomies
    133 * Changed to class autoloader
    134 * Moved instantiation class to it's own file
    135 * Added extendible core class
    136 
    137 = 1.7.2 =
    138 * Bug fix for custom taxonomies
    139 
    140 = 1.7.1 =
    141 * Bug fix to make srcset work correctly on regular header images
    142 
    143 = 1.7 =
    144 * Added support for srcset.
    145 * Confirmed support for TwentySixteen theme.
    146 
    147 = 1.6.1 =
     62= 2.0.7  (2016-19-06) =
    14863* Added checks in file to see if WordPress is loaded.
    14964* Hooking class instantiation in later, due to taxonomies sometimes not being loaded in time.
     65* Updating website domain in readme.txt file.
    15066
    151 = 1.6 =
    152 * Removed admin notice from everywhere but the plugins page.
     67= 2.0.6 (2015-11-26) =
     68* Fixing logged in user bug.
    15369
    154 = 1.5.3 =
    155 * Fixing flawed bug fix from version 1.5.2.
     70= 2.0.5 (2015-10-29) =
     71* Removed the plugin review class due to strange errors.
    15672
    157 = 1.5.2 =
    158 * Fixing bug reported by multiple users, which caused PHP errors on some setups.
     73= 2.0.4 (2015-10-27) =
     74* Upgraded the plugin review class
    15975
    160 = 1.5.1 =
    161 * Overhauled outdated FAQ section of readme.
     76= 2.0.3 (2015-10-27) =
     77* Upgraded the plugin review class
    16278
    163 = 1.5 =
    164 * Introduced unlimited taxonomy support.
    165 * When using a blog page set to a static page URL, the image from the static pages custom header will be used.
    166 * Adding support for all publicly viewable post-types.
    167 * Adding support for all publicly viewable taxonomies.
     79= 2.0.2 (2015-10-26) =
     80* Upgraded the plugin review class
    16881
    169 = 1.4.8 =
    170 * Fixing a bug triggered by WordPress assigning non-URL's as the URL.
     82= 2.0.1 (2015-8-3) =
     83* Implemented text image CAPTCHA fallback for when comment detected as spam
    17184
    172 = 1.4.7
    173 * Setting a more sane plugin review time.
     85= 2.0 (2015-8-1) =
     86* Implemented text image CAPTCHA fallback for when comment detected as spam
     87* Improved performance via selective loading of PHP files
     88* Improved documentation
     89* Added additional links on plugins page
     90* Implemented time-limit for answering CAPTCHA questions
     91* Addition of notices in back-end to describe what checks the comment passed
     92* Removal of spam cleanout since redundant after addition of CAPTCHA fallback
     93* Fixed bug which triggered legit comments to be detected as spam due to commenting too quickly. Time limit was adjusted from five seconds to two seconds to fix this.
    17494
    175 = 1.4.6 =
    176 * Fixing bug with handling taxonomies. Added plugin review notice back, but without the non-existent MONTH_IN_SECONDS constant.
     95= 1.4.3 (2014-12-24) =
     96* Support for WordPress 4.1+ added.
     97* Added translation string specification in header.
    17798
    178 = 1.4.5 =
    179 * Removing plugin review notice due to unsolvable errors.
     99= 1.4.2 (2014-10-17) =
     100* Fixed a bug in the spam checking that (I think) would have cleared the content of bbPress posts for logged in users
     101* Fixed various spellling errors and grammar wrongs
     102* Updated version compatibility
    180103
    181 = 1.4.4 =
    182 * Adding plugin review class back, with correct time stamp set.
     104= 1.4.1 (2014-4-19) =
     105* Cleaning up PHPDocs
    183106
    184 = 1.4.3 =
    185 * Temporarily removing plugin review class until bugs are fixed.
     107= 1.4 (2014-3-21) =
     108* Now automatically deletes spam comments older than a set time (5 days)
     109* Removed kill.php from trunk
     110* Updated readme file for current WordPress Release
    186111
    187 = 1.4.2 =
    188 * Adding a plugin review class.
     112= 1.3.2 (2013-6-24) =
     113* Fixed short cookie time bug thanks to Milan Dinić
    189114
    190 = 1.4.1 =
    191 * Instantiating the plugin later (allows for adding additional post-types in themes).
     115= 1.3.1 (2013-3-18) =
     116* Fixed bug which prevented user registration
     117* Thanks to Marte Sollund and Ingvild Evje of <a href="http://nettsett.no/">Nettsett</a> for an excellent bug report
    192118
    193 = 1.4 =
    194 * Adding backwards compatibility to maintain header images provided by the Taxonomy metadata plugin.
     119= 1.3 (2013-3-6) =
     120* Instantiated class to variable to allow for remove hooks and filters when necessary
     121* Added redirect after spam comment detected
     122* Added error notice on redirection due to spam comment detection
    195123
    196 = 1.3.12 =
    197 * Added French language translation.
     124= 1.2.5 (2012-8-19) =
     125* Changed from kill.php file to kill.js file
     126* Allows for caching of payload
     127* Allows for automatic script concatentation
     128* Cookie creation achieved via raw JS
     129* Key is passed to script via wp_localize_script()
    198130
    199 = 1.3.11 =
    200 * Moved instantiation and localization code into a class.
     131= 1.2.4 (2012-8-11) =
     132* Re-removed requirement for jQuery
     133* Added try / catch to JS to ensure it doesn't fail
     134* Moved JS enqueue to form field area so that it only loads when needed
     135* Added Bjørn Johansen to the contributor list
     136* Added correct mime-type to JS file
    201137
    202 = 1.3.10 =
    203 * Added Deutsch (German) language translation.
     138= 1.2.3 (2012-8-9) =
     139* Added requirement for jQuery due to bug with code introduced in 1.2.2
    204140
    205 = 1.3.9 =
    206 * Fixing error which caused header images to disappear on upgrading (data was still available just not accessed correctly).
     141= 1.2.2 (2012-8-9) =
     142* Removed need for jQuery
    207143
    208 = 1.3.8 =
    209 * Modification translation system to work with changes on WordPress.org.
     144= 1.2.1 (2012-8-9) =
     145* Moved script to footer on advice of Ronald Huereca and Bjørn Johansen
     146* Fixed potential security flaw in kill.php
    210147
    211 = 1.3.7 =
    212 * Addition of Spanish translation.
    213  
    214 = 1.3.1 =
    215 * Adjustment to match post meta key to other plugins, for compatibilty reasons.
     148= 1.2 (2012-8-5) =
     149* Fixed multisite and BuddyPress bugs
     150* Added support for bbPress registrations
     151* Added support for bbPress guest posting protection
     152* Removed the "bad word" list
    216153
    217 = 1.3 =
    218 * Total rewrite to use custom built in system for media uploads. Also adapted taxonomies to use ID's and added support for extra post-types and taxonomies.
     154= 1.1 (2012-8-5) =
     155* Added support for BuddyPress signup page
     156* Added support for WordPress multisite signup page
    219157
    220 = 1.2 =
    221 * Converted to use the class from the Multiple Featured Images plugin.
     158= 1.0.3 (2012-7-30) =
     159* Upgrade to documentation
    222160
    223 = 1.1 =
    224 * Added support for tags.
     161= 1.0.2 (2012-7-30) =
     162* Changed name to 'spam-destroyer'
    225163
    226 = 1.0.4 =
    227 * Added support for displaying a category specific image on the single post pages.
     164= 1.0.1 (2012-7-30) =
     165* Cleaned up some legacy code from older implementations
    228166
    229 = 1.0.3 =
    230 * Correction for $new_url for categories.
     167= 1.0 (2012-7-29) =
     168* Initial release
    231169
    232 = 1.0.2 =
    233 * Bug fix to allow default header to display when no category specified.
    234 
    235 = 1.0.1 =
    236 * Bug fixes for post/page thumbnails.
    237 
    238 = 1.0 =
    239 * Initial release.
     170<small>Any beta/alpha versions to be released in future, will be posted for download on the <a href="https://geek.hellyer.kiwi/products/spam-destroyer/">Spam Destroyer plugin page</a>.</small>
    240171
    241172
    242 = Credits =
     173== Credits ==
    243174
    244 Thanks to the following for help with the development of this plugin:<br />
    245 * <a href="http://www.redactsolutions.co.uk">redactuk - Assistance with debugging.
    246 * <a href="http://www.datamind.co.uk/">crabsallover - Assitance with debugging.
    247 * <a href="http://onmytodd.org">Todd</a> - Assistance with implementing support for tags.
    248 * <a href="http://westoresolutions.com/">Mariano J. Ponce</a> - Spanish translation.
    249 * <a href="http://www.graphicana.de/">Tobias Klotz</a> - Deutsch (German) language translation.
    250 * <a href="http://nakri.co.uk/">Nadia Tokerud</a> - Proof-reading of Norsk Bokmål (Norwegian) translation.
    251 * <a href="http://bjornjohansen.no/">Bjørn Johansen</a> - Proof-reading of Norwegian Bokmål translation.
    252 * <a href="https://www.facebook.com/kaljam/">Karl Olofsson</a> - Proof-reading of Swedish translation.
    253 * <a href="http://www.jennybeaumont.com/">Jenny Beaumont</a> - French translation.
     175* <a href="https://wordpress.org/support/profile/stromhalm">Stromhalm</a> - Bug reporting<br />
     176* <a href="http://ocaoimh.ie/">Donncha O Caoimh</a> - Developer of Cookies for Comments, functionality of which is incorporated into Spam Destroyer<br />
     177* <a href="http://elliottback.com/">Elliot Back</a> - Developer of WP Hashcash, functionality of which is incorporated into Spam Destroyer<br />
     178* <a href="http://nettsett.no/">Marte Sollund and Ingvild Evje</a> - Bug reporting<br />
     179* <a href="http://eHermitsInc.com/">Brian Layman</a> - Code advice<br />
     180* <a href="http://ronalfy.com/">Ronald Huereca</a> - JS advice<br />
     181* <a href="https://twitter.com/shawngaffney">Shawn Gaffney</a> - Bug reporting<br />
     182* <a href="http://konstruktors.com/">Kaspars Dambis</a> - Bug reporting<br />
     183* <a href="http://www.wanderingjon.com/">Jon Brown</a> - Added error message filter</br />
Note: See TracChangeset for help on using the changeset viewer.