Changeset 3392279
- Timestamp:
- 11/08/2025 11:43:44 PM (5 months ago)
- Location:
- no-page-comment
- Files:
-
- 62 added
- 2 deleted
- 6 edited
-
tags/1.3.0 (added)
-
tags/1.3.0/LICENSE (added)
-
tags/1.3.0/composer.json (added)
-
tags/1.3.0/inc (added)
-
tags/1.3.0/inc/class-notification.php (added)
-
tags/1.3.0/inc/class-plugin.php (added)
-
tags/1.3.0/inc/class-settings-view.php (added)
-
tags/1.3.0/inc/class-settings.php (added)
-
tags/1.3.0/lang (added)
-
tags/1.3.0/lang/no-page-comment-de_DE.MO (added)
-
tags/1.3.0/lang/no-page-comment-es_ES.mo (added)
-
tags/1.3.0/lang/no-page-comment-fr_FR.mo (added)
-
tags/1.3.0/lang/no-page-comment-fr_FR.po (added)
-
tags/1.3.0/lang/no-page-comment-it_IT.mo (added)
-
tags/1.3.0/lang/no-page-comment-nl_NL.mo (added)
-
tags/1.3.0/lang/no-page-comment-sr_RS.mo (added)
-
tags/1.3.0/lang/no-page-comment-sv_SE.mo (added)
-
tags/1.3.0/lang/no-page-comment-sv_SE.po (added)
-
tags/1.3.0/lang/no-page-comment.pot (added)
-
tags/1.3.0/no-page-comment.css (added)
-
tags/1.3.0/no-page-comment.js (added)
-
tags/1.3.0/no-page-comment.php (added)
-
tags/1.3.0/readme.txt (added)
-
tags/1.3.0/uninstall.php (added)
-
tags/1.3.0/vendor (added)
-
tags/1.3.0/vendor/autoload.php (added)
-
tags/1.3.0/vendor/composer (added)
-
tags/1.3.0/vendor/composer/ClassLoader.php (added)
-
tags/1.3.0/vendor/composer/InstalledVersions.php (added)
-
tags/1.3.0/vendor/composer/LICENSE (added)
-
tags/1.3.0/vendor/composer/autoload_classmap.php (added)
-
tags/1.3.0/vendor/composer/autoload_namespaces.php (added)
-
tags/1.3.0/vendor/composer/autoload_psr4.php (added)
-
tags/1.3.0/vendor/composer/autoload_real.php (added)
-
tags/1.3.0/vendor/composer/autoload_static.php (added)
-
tags/1.3.0/vendor/composer/installed.json (added)
-
tags/1.3.0/vendor/composer/installed.php (added)
-
tags/1.3.0/vendor/composer/platform_check.php (added)
-
trunk/LICENSE (added)
-
trunk/composer.json (added)
-
trunk/inc (added)
-
trunk/inc/class-notification.php (added)
-
trunk/inc/class-plugin.php (added)
-
trunk/inc/class-settings-view.php (added)
-
trunk/inc/class-settings.php (added)
-
trunk/lang/no-page-comment-fr_FR.mo (added)
-
trunk/lang/no-page-comment-fr_FR.po (added)
-
trunk/lang/no-page-comment-sv_SE.mo (modified) (previous)
-
trunk/lang/no-page-comment-sv_SE.po (modified) (1 diff)
-
trunk/lang/no-page-comment.pot (modified) (1 diff)
-
trunk/no-page-comment-settings.php (deleted)
-
trunk/no-page-comment.js (added)
-
trunk/no-page-comment.php (modified) (2 diffs)
-
trunk/page-comment.js (deleted)
-
trunk/readme.txt (modified) (3 diffs)
-
trunk/uninstall.php (modified) (1 diff)
-
trunk/vendor (added)
-
trunk/vendor/autoload.php (added)
-
trunk/vendor/composer (added)
-
trunk/vendor/composer/ClassLoader.php (added)
-
trunk/vendor/composer/InstalledVersions.php (added)
-
trunk/vendor/composer/LICENSE (added)
-
trunk/vendor/composer/autoload_classmap.php (added)
-
trunk/vendor/composer/autoload_namespaces.php (added)
-
trunk/vendor/composer/autoload_psr4.php (added)
-
trunk/vendor/composer/autoload_real.php (added)
-
trunk/vendor/composer/autoload_static.php (added)
-
trunk/vendor/composer/installed.json (added)
-
trunk/vendor/composer/installed.php (added)
-
trunk/vendor/composer/platform_check.php (added)
Legend:
- Unmodified
- Added
- Removed
-
no-page-comment/trunk/lang/no-page-comment-sv_SE.po
r966390 r3392279 4 4 msgstr "" 5 5 "Project-Id-Version: No Page Comment 1.0.5\n" 6 "Report-Msgid-Bugs-To: http://wordpress.org/tag/no-page-comment\n" 7 "POT-Creation-Date: 2014-03-02 01:02:56+00:00\n" 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/no-page-comment\n" 7 "POT-Creation-Date: 2025-11-08T23:23:22+00:00\n" 8 "PO-Revision-Date: 2014-08-15 13:14+0100\n" 9 "Last-Translator: Andréas Lundgren <adevade@gmail.com>\n" 10 "Language-Team: 035media <info@035media.se>\n" 11 "Language: sv_SE\n" 8 12 "MIME-Version: 1.0\n" 9 13 "Content-Type: text/plain; charset=UTF-8\n" 10 14 "Content-Transfer-Encoding: 8bit\n" 11 "PO-Revision-Date: 2014-08-15 13:14+0100\n"12 "Last-Translator: Andréas Lundgren <adevade@gmail.com>\n"13 "Language-Team: 035media <info@035media.se>\n"14 15 "X-Generator: Poedit 1.6.7\n" 15 16 "Plural-Forms: nplurals=2; plural=(n != 1);\n" 16 "Language: sv_SE\n"17 17 "X-Poedit-SourceCharset: UTF-8\n" 18 18 19 #: no-page-comment-settings.php:31 19 #. Plugin Name of the plugin 20 #: no-page-comment.php inc/class-settings.php:74 21 msgid "No Page Comment" 22 msgstr "No Page Comment" 23 24 #. Description of the plugin 25 #: no-page-comment.php 26 msgid "" 27 "An admin interface to control the default comment and trackback settings on " 28 "new posts, pages and custom post types." 29 msgstr "" 30 31 #. Author of the plugin 32 #: no-page-comment.php 33 msgid "Seth Alling" 34 msgstr "" 35 36 #. Author URI of the plugin 37 #: no-page-comment.php 38 msgid "https://sethalling.com/" 39 msgstr "" 40 41 #: inc/class-notification.php:106 42 msgid "View" 43 msgstr "" 44 45 #: inc/class-notification.php:109 46 msgid "Install" 47 msgstr "" 48 49 #: inc/class-notification.php:115 50 msgid "Help your pages load faster for readers with Easy Critical CSS." 51 msgstr "" 52 53 #: inc/class-notification.php:117 54 msgid "Dismiss this notice" 55 msgstr "" 56 57 #: inc/class-notification.php:127 58 msgid "Insufficient permissions" 59 msgstr "" 60 61 #: inc/class-settings-view.php:36 20 62 msgid "Settings Updated." 21 63 msgstr "Inställningarna sparades." 22 64 23 #: no-page-comment-settings.php:35 no-page-comment.php:152 65 #: inc/class-settings-view.php:48 inc/class-settings.php:73 66 #: inc/class-settings.php:114 24 67 msgid "No Page Comment Settings" 25 68 msgstr "Inställningar för No Page Comment" 26 69 27 #: no-page-comment-settings.php:4428 msgid " Disable comments on new:"29 msgstr " Inaktivera kommentarer på nya:"30 31 #: no-page-comment-settings.php:5370 #: inc/class-settings-view.php:57 71 msgid "Checked boxes will disable comments or trackbacks on new:" 72 msgstr "" 73 74 #: inc/class-settings-view.php:75 32 75 msgid "Comments" 33 76 msgstr "Kommentarer" 34 77 35 #: no-page-comment-settings.php:5578 #: inc/class-settings-view.php:77 36 79 msgid "Trackbacks" 37 80 msgstr "Trackbacks" 38 81 39 #: no-page-comment-settings.php:63 82 #: inc/class-settings-view.php:85 83 #, fuzzy 84 msgctxt "button" 40 85 msgid "Update Settings" 41 86 msgstr "Uppdatera inställningar" 42 87 43 #: no-page-comment-settings.php:7088 #: inc/class-settings-view.php:92 44 89 msgid "Modify all current:" 45 90 msgstr "Redigera alla nuvarande:" 46 91 47 #: no-page-comment-settings.php:7992 #: inc/class-settings-view.php:104 48 93 msgid "Disable All Comments" 49 94 msgstr "Inaktivera alla kommentarer" 50 95 51 #: no-page-comment-settings.php:8096 #: inc/class-settings-view.php:105 52 97 msgid "Enable All Comments" 53 98 msgstr "Aktivera alla kommentarer" 54 99 55 #: no-page-comment-settings.php:83100 #: inc/class-settings-view.php:108 56 101 msgid "Disable All Trackbacks" 57 102 msgstr "Inaktivera alla trackbacks" 58 103 59 #: no-page-comment-settings.php:84104 #: inc/class-settings-view.php:109 60 105 msgid "Enable All Trackbacks" 61 106 msgstr "Aktivera alla trackbacks" 62 107 63 #: no-page-comment-settings.php:101 64 msgid "Other plugins by" 65 msgstr "Andra tillägg av" 66 67 #: no-page-comment-settings.php:110 108 #: inc/class-settings-view.php:126 68 109 msgid "Support No Page Comment:" 69 110 msgstr "Stöd No Page Comment" 70 111 71 #: no-page-comment-settings.php:113112 #: inc/class-settings-view.php:129 72 113 msgid "Donate to support the No Page Comment plugin development" 73 114 msgstr "Donera för att stödja utvecklingen av No Page Comment" 74 115 75 #: no-page-comment-settings.php:113116 #: inc/class-settings-view.php:129 76 117 msgid "Donate" 77 118 msgstr "Donera" 78 119 79 #: no-page-comment-settings.php:114120 #: inc/class-settings-view.php:130 80 121 msgid "Write a Review about No Page Comment" 81 122 msgstr "Skriv en recension om No Page Comment" 82 123 83 #: no-page-comment-settings.php:114124 #: inc/class-settings-view.php:130 84 125 msgid "Write a Review" 85 126 msgstr "Skriv en recension" 86 127 87 #: no-page-comment-settings.php:115128 #: inc/class-settings-view.php:131 88 129 msgid "Fork No Page Comment on Github" 89 130 msgstr "Fork No Page Comment på GitHub" 90 131 91 #: no-page-comment-settings.php:115132 #: inc/class-settings-view.php:131 92 133 msgid "Fork No Page Comment" 93 134 msgstr "Fork No Page Comment" 94 135 95 #: no-page-comment-settings.php:116136 #: inc/class-settings-view.php:132 96 137 msgid "Report an Issue on Github" 97 138 msgstr "Rapportera ett problem på GitHub" 98 139 99 #: no-page-comment-settings.php:116140 #: inc/class-settings-view.php:132 100 141 msgid "Report an Issue about No Page Comment" 101 142 msgstr "Rapportera ett problem med No Page Comment" 102 143 103 #: no-page-comment-settings.php:117 104 msgid "Help Translate No Page Comment" 105 msgstr "Hjälp till att översätta No Page Comment" 106 107 #: no-page-comment-settings.php:117 108 msgid "Offer to Translate No Page Comment" 109 msgstr "Översätt No Page Comment" 110 111 #: no-page-comment-settings.php:123 144 #: inc/class-settings-view.php:138 112 145 msgid "Translation Thanks:" 113 146 msgstr "Översättningar av:" 114 147 115 #: no-page-comment.php:133 148 #: inc/class-settings-view.php:141 149 msgid "Dutch and Italian:" 150 msgstr "" 151 152 #: inc/class-settings-view.php:142 153 msgid "French:" 154 msgstr "" 155 156 #: inc/class-settings-view.php:143 157 msgid "Serbian:" 158 msgstr "" 159 160 #: inc/class-settings-view.php:144 161 msgid "Spanish:" 162 msgstr "" 163 164 #: inc/class-settings-view.php:145 165 msgid "Swedish:" 166 msgstr "" 167 168 #: inc/class-settings.php:66 116 169 msgid "Settings" 117 170 msgstr "Inställningar" 118 171 119 #: no-page-comment.php:152172 #: inc/class-settings.php:112 120 173 msgid "Comment and trackback defaults controlled through" 121 174 msgstr "Standardinställningar för kommentarer och trackbacks kontrolleras av" 122 175 123 #. Plugin Name of the plugin/theme 124 msgid "No Page Comment" 125 msgstr "No Page Comment" 126 127 #. Description of the plugin/theme 128 msgid "" 129 "A plugin that uses javascript to disable comments by default on posts, pages " 130 "and/or custom post types but leave them enabled on others, while still " 131 "giving you the ability to individually set them on a page or post basis." 132 msgstr "" 133 "Ett tillägg som använder JavaScript för att inaktivera kommentarer på " 134 "inlägg, sidor och/eller egna inläggstyper men lämnar dem aktiverade på " 135 "andra. " 176 #: inc/class-settings.php:142 inc/class-settings.php:145 177 msgid "You don't have permission to perform this action." 178 msgstr "" 179 180 #: inc/class-settings.php:162 181 msgid "Invalid comment status." 182 msgstr "" 183 184 #: inc/class-settings.php:183 185 msgid "Invalid comment type." 186 msgstr "" 187 188 #: inc/class-settings.php:189 189 msgid "Something went wrong. Please refresh this page and try again." 190 msgstr "" 191 192 #. translators: 1: comment label, 2: post type label, 3: new status. 193 #: inc/class-settings.php:196 194 msgid "All %1$s of %2$s have been marked as %3$s." 195 msgstr "" 196 197 #~ msgid "Disable comments on new:" 198 #~ msgstr "Inaktivera kommentarer på nya:" 199 200 #~ msgid "Other plugins by" 201 #~ msgstr "Andra tillägg av" 202 203 #~ msgid "Help Translate No Page Comment" 204 #~ msgstr "Hjälp till att översätta No Page Comment" 205 206 #~ msgid "Offer to Translate No Page Comment" 207 #~ msgstr "Översätt No Page Comment" 208 209 #~ msgid "" 210 #~ "A plugin that uses javascript to disable comments by default on posts, " 211 #~ "pages and/or custom post types but leave them enabled on others, while " 212 #~ "still giving you the ability to individually set them on a page or post " 213 #~ "basis." 214 #~ msgstr "" 215 #~ "Ett tillägg som använder JavaScript för att inaktivera kommentarer på " 216 #~ "inlägg, sidor och/eller egna inläggstyper men lämnar dem aktiverade på " 217 #~ "andra. " -
no-page-comment/trunk/lang/no-page-comment.pot
r1217740 r3392279 1 # Copyright (C) 20 15 No Page Comment2 # This file is distributed under the same license as the No Page Comment p ackage.1 # Copyright (C) 2025 Seth Alling 2 # This file is distributed under the same license as the No Page Comment plugin. 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: No Page Comment 1.1\n" 6 "Report-Msgid-Bugs-To: http://wordpress.org/tag/no-page-comment\n" 7 "POT-Creation-Date: 2014-03-02 01:02:56+00:00\n" 5 "Project-Id-Version: No Page Comment 1.3.0\n" 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/no-page-comment\n" 7 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" 8 "Language-Team: LANGUAGE <LL@li.org>\n" 8 9 "MIME-Version: 1.0\n" 9 10 "Content-Type: text/plain; charset=UTF-8\n" 10 11 "Content-Transfer-Encoding: 8bit\n" 11 "PO-Revision-Date: 2014-MO-DA HO:MI+ZONE\n" 12 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" 13 "Language-Team: LANGUAGE <LL@li.org>\n" 12 "POT-Creation-Date: 2025-11-08T23:23:22+00:00\n" 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 "X-Generator: WP-CLI 2.11.0\n" 15 "X-Domain: no-page-comment\n" 14 16 15 #: no-page-comment-settings.php:37 17 #. Plugin Name of the plugin 18 #: no-page-comment.php 19 #: inc/class-settings.php:74 20 msgid "No Page Comment" 21 msgstr "" 22 23 #. Description of the plugin 24 #: no-page-comment.php 25 msgid "An admin interface to control the default comment and trackback settings on new posts, pages and custom post types." 26 msgstr "" 27 28 #. Author of the plugin 29 #: no-page-comment.php 30 msgid "Seth Alling" 31 msgstr "" 32 33 #. Author URI of the plugin 34 #: no-page-comment.php 35 msgid "https://sethalling.com/" 36 msgstr "" 37 38 #: inc/class-notification.php:106 39 msgid "View" 40 msgstr "" 41 42 #: inc/class-notification.php:109 43 msgid "Install" 44 msgstr "" 45 46 #: inc/class-notification.php:115 47 msgid "Help your pages load faster for readers with Easy Critical CSS." 48 msgstr "" 49 50 #: inc/class-notification.php:117 51 msgid "Dismiss this notice" 52 msgstr "" 53 54 #: inc/class-notification.php:127 55 msgid "Insufficient permissions" 56 msgstr "" 57 58 #: inc/class-settings-view.php:36 16 59 msgid "Settings Updated." 17 60 msgstr "" 18 61 19 #: no-page-comment-settings.php:41 no-page-comment.php:153 no-page-comment.php:163 62 #: inc/class-settings-view.php:48 63 #: inc/class-settings.php:73 64 #: inc/class-settings.php:114 20 65 msgid "No Page Comment Settings" 21 66 msgstr "" 22 67 23 #: no-page-comment-settings.php:5024 msgid " Disable comments on new:"68 #: inc/class-settings-view.php:57 69 msgid "Checked boxes will disable comments or trackbacks on new:" 25 70 msgstr "" 26 71 27 #: no-page-comment-settings.php:5972 #: inc/class-settings-view.php:75 28 73 msgid "Comments" 29 74 msgstr "" 30 75 31 #: no-page-comment-settings.php:6176 #: inc/class-settings-view.php:77 32 77 msgid "Trackbacks" 33 78 msgstr "" 34 79 35 #: no-page-comment-settings.php:69 80 #: inc/class-settings-view.php:85 81 msgctxt "button" 36 82 msgid "Update Settings" 37 83 msgstr "" 38 84 39 #: no-page-comment-settings.php:7685 #: inc/class-settings-view.php:92 40 86 msgid "Modify all current:" 41 87 msgstr "" 42 88 43 #: no-page-comment-settings.php:8589 #: inc/class-settings-view.php:104 44 90 msgid "Disable All Comments" 45 91 msgstr "" 46 92 47 #: no-page-comment-settings.php:8693 #: inc/class-settings-view.php:105 48 94 msgid "Enable All Comments" 49 95 msgstr "" 50 96 51 #: no-page-comment-settings.php:8997 #: inc/class-settings-view.php:108 52 98 msgid "Disable All Trackbacks" 53 99 msgstr "" 54 100 55 #: no-page-comment-settings.php:90101 #: inc/class-settings-view.php:109 56 102 msgid "Enable All Trackbacks" 57 103 msgstr "" 58 104 59 #: no-page-comment-settings.php:107 60 msgid "Other plugins by" 61 msgstr "" 62 63 #: no-page-comment-settings.php:116 105 #: inc/class-settings-view.php:126 64 106 msgid "Support No Page Comment:" 65 107 msgstr "" 66 108 67 #: no-page-comment-settings.php:119109 #: inc/class-settings-view.php:129 68 110 msgid "Donate to support the No Page Comment plugin development" 69 111 msgstr "" 70 112 71 #: no-page-comment-settings.php:119113 #: inc/class-settings-view.php:129 72 114 msgid "Donate" 73 115 msgstr "" 74 116 75 #: no-page-comment-settings.php:120117 #: inc/class-settings-view.php:130 76 118 msgid "Write a Review about No Page Comment" 77 119 msgstr "" 78 120 79 #: no-page-comment-settings.php:120121 #: inc/class-settings-view.php:130 80 122 msgid "Write a Review" 81 123 msgstr "" 82 124 83 #: no-page-comment-settings.php:121125 #: inc/class-settings-view.php:131 84 126 msgid "Fork No Page Comment on Github" 85 127 msgstr "" 86 128 87 #: no-page-comment-settings.php:121129 #: inc/class-settings-view.php:131 88 130 msgid "Fork No Page Comment" 89 131 msgstr "" 90 132 91 #: no-page-comment-settings.php:122133 #: inc/class-settings-view.php:132 92 134 msgid "Report an Issue on Github" 93 135 msgstr "" 94 136 95 #: no-page-comment-settings.php:122137 #: inc/class-settings-view.php:132 96 138 msgid "Report an Issue about No Page Comment" 97 139 msgstr "" 98 140 99 #: no-page-comment-settings.php:123 100 msgid "Help Translate No Page Comment" 101 msgstr "" 102 103 #: no-page-comment-settings.php:123 104 msgid "Offer to Translate No Page Comment" 105 msgstr "" 106 107 #: no-page-comment-settings.php:129 141 #: inc/class-settings-view.php:138 108 142 msgid "Translation Thanks:" 109 143 msgstr "" 110 144 111 #: no-page-comment-settings.php:132145 #: inc/class-settings-view.php:141 112 146 msgid "Dutch and Italian:" 113 147 msgstr "" 114 148 115 #: no-page-comment-settings.php:133 149 #: inc/class-settings-view.php:142 150 msgid "French:" 151 msgstr "" 152 153 #: inc/class-settings-view.php:143 116 154 msgid "Serbian:" 117 155 msgstr "" 118 156 119 #: no-page-comment-settings.php:134157 #: inc/class-settings-view.php:144 120 158 msgid "Spanish:" 121 159 msgstr "" 122 160 123 #: no-page-comment-settings.php:135161 #: inc/class-settings-view.php:145 124 162 msgid "Swedish:" 125 163 msgstr "" 126 164 127 #: no-page-comment.php:144165 #: inc/class-settings.php:66 128 166 msgid "Settings" 129 167 msgstr "" 130 168 131 #: no-page-comment.php:163169 #: inc/class-settings.php:112 132 170 msgid "Comment and trackback defaults controlled through" 133 171 msgstr "" 134 172 135 #. Plugin Name of the plugin/theme no-page-comment.php:153 136 msgid "No Page Comment" 173 #: inc/class-settings.php:142 174 #: inc/class-settings.php:145 175 msgid "You don't have permission to perform this action." 137 176 msgstr "" 138 177 139 #. Description of the plugin/theme 140 msgid "" 141 "An admin interface to control the default comment and trackback settings on " 142 "new posts, pages and custom post types." 178 #: inc/class-settings.php:162 179 msgid "Invalid comment status." 143 180 msgstr "" 181 182 #: inc/class-settings.php:183 183 msgid "Invalid comment type." 184 msgstr "" 185 186 #: inc/class-settings.php:189 187 msgid "Something went wrong. Please refresh this page and try again." 188 msgstr "" 189 190 #. translators: 1: comment label, 2: post type label, 3: new status. 191 #: inc/class-settings.php:196 192 msgid "All %1$s of %2$s have been marked as %3$s." 193 msgstr "" -
no-page-comment/trunk/no-page-comment.php
r2787342 r3392279 1 1 <?php 2 2 /* 3 Plugin Name: No Page Comment 4 Plugin URI: http://sethalling.com/plugins/no-page-comment 5 Description: An admin interface to control the default comment and trackback settings on new posts, pages and custom post types. 6 Version: 1.2 7 Requires at least: 3.1 8 Requires PHP: 7.0 9 Author: Seth Alling 10 Author URI: http://sethalling.com/ 11 Text Domain: no-page-comment 3 * Plugin Name: No Page Comment 4 * Description: An admin interface to control the default comment and trackback settings on new posts, pages and custom post types. 5 * Version: 1.3.0 6 * Requires at least: 6.2 7 * Tested up to: 6.8.2 8 * Requires PHP: 7.4 9 * Author: Seth Alling 10 * Author URI: https://sethalling.com/ 11 * Text Domain: no-page-comment 12 * 13 * @package NoPageComment 14 * 15 * _____ _ _ _ _ _ _...._ 16 * / ____| | | | | /\ | | (_) .'/ \ _'. 17 * | (___ ___| |_| |__ / \ | | |_ _ __ __ _ /##\__/##\_\ 18 * \___ \ / _ \ __| '_ \ / /\ \ | | | | '_ \ / _` | |\##/ \##/ | 19 * ____) | __/ |_| | | | / ____ \| | | | | | | (_| | |/ \__/ \ _| 20 * |_____/ \___|\__|_| |_| /_/ \_\_|_|_|_| |_|\__, | \ _/##\__/#/ 21 * __/ | '.\##/__.' 22 * Plugin developed by: https://sethalling.com |___/ `""""` 23 */ 12 24 13 Plugin: Copyright (c) 2011-2022 Seth Alling 14 15 This program is free software; you can redistribute it and/or 16 modify it under the terms of the GNU General Public License 17 as published by the Free Software Foundation; either version 2 18 of the License, or (at your option) any later version. 19 20 This program is distributed in the hope that it will be useful, 21 but WITHOUT ANY WARRANTY; without even the implied warranty of 22 MERCHANTABILITY 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 28 _____ _ _ _ _ _ _...._ 29 / ____| | | | | /\ | | (_) .'/ \ _'. 30 | (___ ___| |_| |__ / \ | | |_ _ __ __ _ /##\__/##\_\ 31 \___ \ / _ \ __| '_ \ / /\ \ | | | | '_ \ / _` | |\##/ \##/ | 32 ____) | __/ |_| | | | / ____ \| | | | | | | (_| | |/ \__/ \ _| 33 |_____/ \___|\__|_| |_| /_/ \_\_|_|_|_| |_|\__, | \ _/##\__/#/ 34 __/ | '.\##/__.' 35 Plugin developed by: http://sethalling.com |___/ `""""` 36 */ 25 namespace NoPageComment; 37 26 38 27 // Prevent direct access … … 41 30 } 42 31 43 register_activation_hook( __FILE__, 'sta_npc_activate' ); 44 45 define( 'STA_NPC_WP_VERSION', version_compare( get_bloginfo( 'version' ), '3.4', '>=' ) ); 46 47 if ( ! function_exists( 'sta_npc_activate' ) ) { 48 function sta_npc_activate() { 49 sta_npc_load(); 50 global $sta_npc_plugin; 51 } 32 if ( ! defined( 'ABSPATH' ) ) { 33 exit; 52 34 } 53 35 54 // Set text domain for translation 55 function sta_load_text_domain() { 56 load_plugin_textdomain( 'no-page-comment', false, basename( dirname( __FILE__ ) ) . '/lang/' ); 57 } 58 add_action( 'init', 'sta_load_text_domain' ); // Set text domain for translation 36 // Load Composer autoload. 37 require_once plugin_dir_path( __FILE__ ) . 'vendor/autoload.php'; 59 38 60 if ( ! function_exists( 'sta_npc_load' ) ) { 61 62 function sta_npc_load() { 63 64 if ( ! class_exists( 'STA_NPC_Plugin' ) ) { 65 66 class STA_NPC_Plugin { 67 68 var $admin_options_name = 'sta_npc_options', 69 $admin_options_name_old = 'sta_npc_admin_options_name', 70 $plugin_domain = 'no-page-comment'; 71 public $plugin_name = 'no-page-comment'; 72 public $plugin_file; 73 public $plugin_dir; 74 public $wp_posttypes = array( 75 'post', 76 'page', 77 'revision', 78 'nav_menu_item', 79 'attachment' 80 ); 81 82 public $excluded_posttypes = array( 83 'revision', 84 'nav_menu_item', 85 ); 86 87 public $plugin_ver = '1.2'; 88 89 // Plugin Constructor 90 function __construct() { 91 $this->plugin_dir = plugins_url( '/', __FILE__ ); 92 $this->plugin_file = $this->plugin_name . '.php'; 93 } 94 95 // Intialize Admin Options 96 function sta_npc_init() { 97 $this->sta_npc_get_admin_options(); 98 } 99 100 // Returns an array of admin options 101 function sta_npc_get_admin_options() { 102 103 // Rename options from old options name 104 if ( get_option( $this->admin_options_name_old ) ) { 105 update_option( $this->admin_options_name, get_option( $this->admin_options_name_old ) ); 106 delete_option( $this->admin_options_name_old ); 107 } 108 109 $sta_npc_admin_options = array( 110 'disable_comments_post' => '', 111 'disable_trackbacks_post' => '', 112 'disable_comments_page' => 'true', 113 'disable_trackbacks_page' => 'true', 114 'disable_comments_attachment' => '', 115 'disable_trackbacks_attachment' => '' 116 ); 117 118 foreach ( get_post_types( '', 'objects' ) as $posttype ) { 119 if ( in_array( $posttype->name, $this->wp_posttypes ) ) 120 continue; 121 122 $sta_npc_admin_options['disable_comments_' . $posttype->name] = 'true'; 123 $sta_npc_admin_options['disable_trackbacks_' . $posttype->name] = 'true'; 124 } // end foreach post types 125 126 $sta_npc_options = get_option( $this->admin_options_name ); 127 if ( ! empty( $sta_npc_options ) ) { 128 129 foreach ( $sta_npc_options as $key => $option ) 130 $sta_npc_admin_options[$key] = $option; 131 } 132 133 update_option( $this->admin_options_name, $sta_npc_admin_options ); 134 return $sta_npc_admin_options; 135 } 136 137 // Print out the admin page 138 function sta_npc_print_admin_page() { 139 include( dirname( __FILE__ ) . '/no-page-comment-settings.php' ); 140 } 141 142 // Add stylesheet to admin page 143 function sta_npc_admin_styles( $hook ) { 144 if ( $hook == 'settings_page_no-page-comment' ) { 145 wp_register_style( 'sta_npc', $this->plugin_dir . '/no-page-comment.css', false, $this->plugin_ver ); 146 wp_enqueue_style( 'sta_npc' ); 147 } 148 } 149 150 // Add settings link to plugins page 151 function sta_npc_settings_link( $links, $file ) { 152 if ( basename( $file ) == $this->plugin_file ) { 153 $settings_link = '<a href="' . admin_url( 'options-general.php?page=' . $this->plugin_file ) . '">' . __( 'Settings', $this->plugin_domain ) . '</a>'; 154 array_unshift( $links, $settings_link ); 155 } 156 return $links; 157 } 158 159 // Add settings page to options sidebar 160 function sta_npc_plugin_admin() { 161 if ( function_exists( 'add_options_page' ) ) { 162 add_options_page( __( 'No Page Comment Settings', $this->plugin_domain ), __( 'No Page Comment', $this->plugin_domain ), 'manage_options', $this->plugin_file, array( $this, 'sta_npc_print_admin_page' ) ); 163 } 164 } 165 166 // Modify discussion options page with a link to NPC settings page 167 function sta_discussion_options() { 168 global $pagenow; 169 global $post; 170 171 if ( ( is_admin() ) && ( $pagenow == 'options-discussion.php' ) ) { 172 $settings_link = __( 'Comment and trackback defaults controlled through', $this->plugin_domain ) . ' <a href="' . admin_url( 'options-general.php?page=' . $this->plugin_file ) . '">' . __( 'No Page Comment Settings', $this->plugin_domain ) . '</a>'; 173 wp_enqueue_script( 'jquery' ); ?> 174 175 <script type="text/javascript"> 176 jQuery(document).ready( function() { 177 jQuery('label[for="default_ping_status"]').remove().prev('br').remove(); 178 jQuery('label[for="default_comment_status"]').prev('br').remove(); 179 jQuery('label[for="default_comment_status"]').next('br').remove(); 180 jQuery('label[for="default_comment_status"]').next('p').html('<?php echo $settings_link; ?>'); 181 jQuery('label[for="default_comment_status"]').next('small').html('<?php echo $settings_link; ?>'); 182 jQuery('label[for="default_comment_status"]').remove(); 183 }); 184 </script> 185 186 <?php } 187 } 188 189 // Disable comments and trackbacks on at least WP version 4.3 with a hook 190 function wpdocs_open_comments_for_myposttype( $status, $post_type, $comment_type ) { 191 $sta_npc_options = $this->sta_npc_get_admin_options(); 192 193 if ( $comment_type == 'comment' ) { // Check if comment or trackback 194 195 if ( isset( $sta_npc_options['disable_comments_' . $post_type] ) ) { 196 197 if ( $sta_npc_options['disable_comments_' . $post_type] == 'true' ) { 198 return 'closed'; 199 } else { 200 return 'open'; 201 } 202 203 } else { 204 return $status; 205 } 206 207 } elseif ( $comment_type == 'pingback' ) { // Double check if trackback 208 209 if ( isset( $sta_npc_options['disable_trackbacks_' . $post_type] ) ) { 210 211 if ( $sta_npc_options['disable_trackbacks_' . $post_type] == 'true' ) { 212 return 'closed'; 213 } else { 214 return 'open'; 215 } 216 217 } else { 218 return $status; 219 } 220 221 } else { // This should never happen, but just in case 222 return $status; 223 } 224 225 } 226 227 // Disable comments with hook on WP versions 3.4-4.2 228 function sta_no_page_comment() { 229 global $pagenow; 230 $sta_npc_options = $this->sta_npc_get_admin_options(); 231 if ( ( is_admin() ) && ( $pagenow == 'post-new.php' ) ) { 232 $posttype = ( isset( $_GET['post_type'] ) ) ? $_GET['post_type'] : 'post'; 233 234 if ( $sta_npc_options['disable_comments_' . $posttype] == 'true' ) { 235 return 'closed'; 236 } else { 237 return 'open'; 238 } 239 } 240 } 241 242 // Disable trackbacks with hook on versions 3.4-4.2 243 function sta_no_page_trackback() { 244 global $pagenow; 245 $sta_npc_options = $this->sta_npc_get_admin_options(); 246 if ( ( is_admin() ) && ( $pagenow == 'post-new.php' ) ) { 247 $posttype = ( isset( $_GET['post_type'] ) ) ? $_GET['post_type'] : 'post'; 248 249 if ( $sta_npc_options['disable_trackbacks_' . $posttype] == 'true' ) { 250 return 'closed'; 251 } else { 252 return 'open'; 253 } 254 } 255 } 256 257 // Disable comments/trackbacks with jQuery (for WP versions earlier than 3.4) 258 function sta_no_page_comment_jquery() { 259 global $pagenow; 260 global $post; 261 262 $sta_npc_options = $this->sta_npc_get_admin_options(); 263 if ( ( is_admin() ) && ( $pagenow == 'post-new.php' ) && ( $post->filter == 'raw' ) ) { 264 wp_enqueue_script( 'jquery' ); 265 $posttype = $post->post_type; ?> 266 267 <script type="text/javascript"> 268 jQuery(document).ready( function() { 269 <?php if ( isset($sta_npc_options['disable_comments_' . $posttype]) ) { 270 if ( $sta_npc_options['disable_comments_' . $posttype] == 'true' ) { ?> 271 if ( jQuery('#comment_status').length ) { 272 jQuery('#comment_status').attr('checked', false); 273 } 274 <?php } else { ?> 275 if ( jQuery('#comment_status').length ) { 276 jQuery('#comment_status').attr('checked', true); 277 } 278 <?php } 279 } 280 if ( isset($sta_npc_options['disable_trackbacks_' . $posttype]) ) { 281 if ( $sta_npc_options['disable_trackbacks_' . $posttype] == 'true' ) { ?> 282 if ( jQuery('#ping_status').length ) { 283 jQuery('#ping_status').attr('checked', false); 284 } 285 <?php } else { ?> 286 if ( jQuery('#ping_status').length ) { 287 jQuery('#ping_status').attr('checked', true); 288 } 289 <?php } 290 } ?> 291 }); 292 </script> 293 294 <?php } 295 } 296 297 // Add ajax script to admin page 298 function sta_no_page_comment_ajax() { 299 global $pagenow; 300 global $post; 301 if ( ( is_admin() ) && ( $pagenow == 'options-general.php' ) && isset( $_GET['page'] ) ) { 302 if ( $_GET['page'] == 'no-page-comment.php' ) { 303 wp_enqueue_script( 'jquery' ); 304 // Load Ajax File 305 wp_register_script( 'ajax-script', plugins_url( '/page-comment.js', __FILE__ ), array( 'jquery' ) ); 306 wp_localize_script( 'ajax-script', 'myAjax', array( 'ajaxurl' => admin_url( 'admin-ajax.php' ) ) ); 307 308 wp_enqueue_script( 'jquery' ); 309 wp_enqueue_script( 'ajax-script' ); 310 } 311 } 312 } 313 314 // Ajax Function for WP Comment DB Modification 315 function sta_npc_mod() { 316 if ( ! wp_verify_nonce( $_REQUEST['nonce'], 'sta_npc_nonce') ) { 317 exit( 'No naughty business please' ); 318 } 319 320 global $wpdb; 321 322 $result[] = array(); 323 $comment_type = $_REQUEST['comment_type']; 324 $comment_status = $_REQUEST['comment_status']; 325 if ( $comment_status == 'open' ) 326 $comment_new_status = 'closed'; 327 elseif ( $comment_status == 'closed' ) { 328 $comment_new_status = 'open'; 329 } 330 $post_type = $_REQUEST['post_type']; 331 $post_label = $_REQUEST['post_label']; 332 333 334 if ( $comment_type == 'ping' ) { 335 $comment_label = 'trackbacks'; 336 $comment_query = $wpdb->prepare( 337 " 338 UPDATE $wpdb->posts 339 SET ping_status = %s 340 WHERE ping_status = %s 341 AND post_type = %s 342 ", 343 $comment_new_status, 344 $comment_status, 345 $post_type 346 ); 347 } else { 348 $comment_label = 'comments'; 349 $comment_query = $wpdb->prepare( 350 " 351 UPDATE $wpdb->posts 352 SET comment_status = %s 353 WHERE comment_status = %s 354 AND post_type = %s 355 ", 356 $comment_new_status, 357 $comment_status, 358 $post_type 359 ); 360 } 361 362 if ( $comment_query === FALSE ) { 363 $result['type'] = 'error'; 364 $result['message'] = 'Something went wrong. Please refresh this page and try again.'; 365 } else { 366 $wpdb->query( $comment_query ); 367 $result['type'] = 'success'; 368 $result['message'] = 'All ' . $comment_label . ' of ' . $post_label . ' have been marked as ' . $comment_new_status; 369 } 370 371 if ( ! empty( $_SERVER['HTTP_X_REQUESTED_WITH'] ) && strtolower( $_SERVER['HTTP_X_REQUESTED_WITH'] ) == 'xmlhttprequest' ) { 372 $result = json_encode( $result ); 373 echo $result; 374 } 375 else { 376 header( 'Location: ' . $_SERVER['HTTP_REFERER'] ); 377 } 378 379 die(); 380 381 } 382 383 function nopriv_sta_npc_mod() { 384 exit( 'No naughty business please' ); 385 } 386 387 // Disable comments/trackbacks on attachments 388 function attachment_comment( $id ) { 389 global $wpdb; 390 $sta_npc_options = $this->sta_npc_get_admin_options(); 391 $comment_status = ( $sta_npc_options['disable_comments_attachment'] == 'true' ) ? 'closed' : 'open'; 392 $trackback_status = ( $sta_npc_options['disable_trackbacks_attachment'] == 'true' ) ? 'closed' : 'open'; 393 394 $comment_query = $wpdb->prepare( 395 " 396 UPDATE $wpdb->posts 397 SET comment_status = %s 398 WHERE ID = %s 399 ", 400 $comment_status, 401 $id 402 ); 403 404 $trackback_query = $wpdb->prepare( 405 " 406 UPDATE $wpdb->posts 407 SET ping_status = %s 408 WHERE ID = %s 409 ", 410 $trackback_status, 411 $id 412 ); 413 414 if ( $comment_query === FALSE ) { 415 } else { 416 $wpdb->query( $comment_query ); 417 } 418 419 if ( $trackback_query === FALSE ) { 420 } else { 421 $wpdb->query( $trackback_query ); 422 } 423 424 } 425 426 } 427 428 } // End Class STA_NPC_Plugin 429 430 if ( class_exists( 'STA_NPC_Plugin' ) ) { 431 global $sta_npc_plugin; 432 $sta_npc_plugin = new STA_NPC_Plugin(); 433 } 434 435 // Actions, Filters and Shortcodes 436 if ( isset( $sta_npc_plugin ) ) { 437 // Actions 438 add_action( 'admin_menu', array( &$sta_npc_plugin, 'sta_npc_plugin_admin' ) ); // Activate admin settings page 439 add_action( 'activate_no-page-comment/no-page-comment.php', array( &$sta_npc_plugin, 'sta_npc_init' ) ); // Activate admin options 440 add_action( 'admin_enqueue_scripts', array( &$sta_npc_plugin, 'sta_npc_admin_styles' ) ); // Add admin stylesheet 441 add_action( 'admin_head', array( &$sta_npc_plugin, 'sta_no_page_comment_ajax' ) ); // Add ajax scripts 442 add_action( 'wp_ajax_sta_npc_mod', array( &$sta_npc_plugin, 'sta_npc_mod' ) ); // Add ajax function 443 add_action( 'wp_ajax_nopriv_sta_npc_mod', array( &$sta_npc_plugin, 'nopriv_sta_npc_mod' ) ); // Add logged out ajax function 444 add_action( 'add_attachment', array( &$sta_npc_plugin, 'attachment_comment' ) ); // Set comment status on new attachments 445 446 // Filters 447 add_filter( 'plugin_action_links', array( &$sta_npc_plugin, 'sta_npc_settings_link' ), 10, 2 ); // Add settings link to plugins page 448 add_filter( 'admin_head', array(&$sta_npc_plugin, 'sta_discussion_options' ) ); // Change discussion options replace defaults with link to NPC settings 449 450 // Run correct function depending on version 451 if ( function_exists( 'get_default_comment_status' ) ) { 452 add_filter( 'get_default_comment_status', array(&$sta_npc_plugin, 'wpdocs_open_comments_for_myposttype' ), 10, 3 ); // Comment settings 453 } elseif ( STA_NPC_WP_VERSION ) { 454 add_filter( 'pre_option_default_comment_status', array(&$sta_npc_plugin, 'sta_no_page_comment' ) ); // Comment settings 455 add_filter( 'pre_option_default_ping_status', array(&$sta_npc_plugin, 'sta_no_page_trackback' ) ); // Trackback settings 456 } else { // Use jQuery for WordPress versions earlier than 3.4 457 add_action( 'admin_head', array( &$sta_npc_plugin, 'sta_no_page_comment_jquery' ) ); // Add jquery scripts 458 } 459 460 } 461 462 } 463 464 } 465 466 sta_npc_load(); 39 // Initialize the plugin. 40 Plugin::get_instance( __FILE__ ); -
no-page-comment/trunk/readme.txt
r2787342 r3392279 4 4 Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=5WWP2EDSCAJR4 5 5 Tags: admin, comments, custom post type, discussion, pages, posts, attachment, attachments, media, settings, tools, trackbacks 6 Requires at least: 3.17 Tested up to: 6. 0.18 Requires PHP: 7. 06 Requires at least: 6.2 7 Tested up to: 6.8.2 8 Requires PHP: 7.4 9 9 Stable tag: trunk 10 10 … … 77 77 == Changelog == 78 78 79 = 1.3.0 = 80 * OPTIMIZATION: Convert to class-based architecture and move code into namespaced classes. 81 * OPTIMIZATION: Apply WPCS/PHPCS fixes and improve code cleanliness. 82 * FIX: Hardened nonce checks and input/output sanitization. 83 79 84 = 1.2 = 80 85 * SECURITY: Patch XSS security vulnerability. … … 133 138 == Upgrade Notice == 134 139 140 = 1.3.0 = 141 Refactor to class-based architecture, security hardening, code style and standards improvements, and uninstall cleanup. No user-visible settings were removed; existing settings are preserved during upgrade. 142 135 143 = 1.2 = 136 144 Security fix. Supports PHP 7. Adds database cleanup on uninstall. All previous No Page Comment settings will remain intact with upgrade. -
no-page-comment/trunk/uninstall.php
r1217695 r3392279 1 2 1 <?php 3 // If uninstall is not called from WordPress, exit 2 // If uninstall is not called from WordPress, exit. 4 3 if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) { 5 exit();4 exit; 6 5 } 7 6 8 $option_name = 'sta_npc_admin_options_name'; 7 $sta_npc_options = [ 8 'sta_npc_options', 9 'sta_npc_version', 10 'sta_npc_activation', 11 'sta_npc_admin_options_name', // Very old legacy option in case older installs still have it 12 ]; 9 13 10 delete_option( $option_name ); 14 foreach ( $sta_npc_options as $sta_npc_option ) { 15 delete_option( $sta_npc_option ); 16 } 17 18 // If this is a multisite installation also remove site/network options. 19 if ( function_exists( 'is_multisite' ) && is_multisite() ) { 20 foreach ( $sta_npc_options as $sta_npc_option ) { 21 if ( function_exists( 'delete_site_option' ) ) { 22 delete_site_option( $sta_npc_option ); 23 } 24 } 25 }
Note: See TracChangeset
for help on using the changeset viewer.