Changeset 3176431
- Timestamp:
- 10/27/2024 05:33:54 PM (17 months ago)
- Location:
- xmpp-statistics/trunk
- Files:
-
- 4 edited
-
includes/functions.php (modified) (1 diff)
-
includes/settings.php (modified) (4 diffs)
-
uninstall.php (modified) (1 diff)
-
xmpp-statistics.pot (modified) (14 diffs)
Legend:
- Unmodified
- Added
- Removed
-
xmpp-statistics/trunk/includes/functions.php
r3174505 r3176431 13 13 $response = wp_remote_post(get_option('xmpp_stats_rest_url').'/'.$command, array( 14 14 'headers' => array( 15 'Authorization' => 'Basic '.base64_encode(get_option('xmpp_stats_login').':'.get_option('xmpp_stats_password')),16 'Content-Type' => 'application/json' 15 'Authorization' => empty(get_option('xmpp_stats_oauth_token')) ? 'Basic '.base64_encode(get_option('xmpp_stats_login').':'.get_option('xmpp_stats_password')) : 'Bearer '.get_option('xmpp_stats_oauth_token'), 16 'Content-Type' => 'application/json' 17 17 ), 18 18 'body' => json_encode($arguments, JSON_FORCE_OBJECT), -
xmpp-statistics/trunk/includes/settings.php
r3102789 r3176431 11 11 function xmpp_stats_register_settings() { 12 12 register_setting('xmpp_stats_settings', 'xmpp_stats_rest_url', array('type' => 'string', 'sanitize_callback' => 'trim')); 13 register_setting('xmpp_stats_settings', 'xmpp_stats_login', array('type' => 'string', 'sanitize_email' => 'trim')); 14 register_setting('xmpp_stats_settings', 'xmpp_stats_password', array('type' => 'string', 'sanitize_callback' => 'trim')); 15 register_setting('xmpp_stats_settings', 'xmpp_stats_oauth_token', array('type' => 'string', 'sanitize_callback' => 'trim')); 13 16 register_setting('xmpp_stats_settings', 'xmpp_stats_save_data', array('type' => 'boolean', 'sanitize_callback' => 'boolval')); 14 17 register_setting('xmpp_stats_settings', 'xmpp_stats_delete_old_data', array('type' => 'boolean', 'sanitize_callback' => 'boolval')); 15 register_setting('xmpp_stats_settings', 'xmpp_stats_login', array('type' => 'string', 'sanitize_email' => 'trim'));16 register_setting('xmpp_stats_settings', 'xmpp_stats_password', array('type' => 'string', 'sanitize_callback' => 'trim'));17 18 register_setting('xmpp_stats_settings', 'xmpp_stats_chart_width', array('type' => 'integer', 'sanitize_callback' => 'intval')); 18 19 register_setting('xmpp_stats_settings', 'xmpp_stats_chart_height', array('type' => 'integer', 'sanitize_callback' => 'intval')); … … 131 132 <div id="postbox-container-2" class="postbox-container"> 132 133 <div id="normal-sortables" class="meta-box-sortables"> 133 <div class="postbox"> 134 <h2 class="hndle"><?php _e('Settings', 'xmpp-statistics'); ?></h2> 135 <form id="xmpp-stats-form" method="post" action="options.php"> 136 <?php settings_fields('xmpp_stats_settings'); ?> 134 <form id="xmpp-stats-form" method="post" action="options.php"> 135 <?php settings_fields('xmpp_stats_settings'); ?> 136 <div class="postbox"> 137 <div class="postbox-header"> 138 <h2 class="hndle"><?php _e('ReST API', 'xmpp-statistics'); ?></h2> 139 </div> 137 140 <div class="inside"> 138 141 <table class="form-table"><tbody> … … 153 156 <th><?php _e('Password', 'xmpp-statistics'); ?></th> 154 157 <td> 155 <input name="xmpp_stats_password" id="xmpp_stats_password" type="password" size="40" value="<?php echo get_option('xmpp_stats_password'); ?>" /> 156 </td> 157 </tr> 158 <input name="xmpp_stats_password" id="xmpp_stats_password" type="password" size="40" autocomplete="new-password" value="<?php echo get_option('xmpp_stats_password'); ?>" /> 159 </td> 160 </tr> 161 <tr> 162 <th><?php _e('OAuth token', 'xmpp-statistics'); ?></th> 163 <td> 164 <input name="xmpp_stats_oauth_token" id="xmpp_stats_oauth_token" type="text" size="40" value="<?php echo get_option('xmpp_stats_oauth_token'); ?>" /> 165 <p class="description"><?php printf(__('Use instead of classic login and password access. The plugin doesn\'t generate and check the expiration date of OAuth tokens, so you need to generate OAuth token for your own with long expiration date. To generate a token use the oauth_issue_token command with the ejabberdctl shell script e.g.: %s', 'xmpp-statistics'), '<kbd>ejabberdctl oauth_issue_token bot@'.preg_replace('/^www\./','',$_SERVER['SERVER_NAME']).' 315360000 ejabberd:admin</kbd>'); ?></p> 166 </td> 167 </tr> 168 </tbody></table> 169 </div> 170 </div> 171 <div class="postbox"> 172 <div class="postbox-header"> 173 <h2 class="hndle"><?php _e('Charts with statistics', 'xmpp-statistics'); ?></h2> 174 </div> 175 <div class="inside"> 176 <table class="form-table"><tbody> 158 177 <tr> 159 178 <th><?php _e('Statistics', 'xmpp-statistics'); ?></th> 160 179 <td> 161 180 <label for="xmpp_stats_save_data"><input name="xmpp_stats_save_data" id="xmpp_stats_save_data" type="checkbox" value="1" <?php checked(1, get_option('xmpp_stats_save_data', false)); ?> /><?php _e('Save statistics', 'xmpp-statistics'); ?></label> 162 <p class="description"><?php printf(__('Automatically retrieves server statistics every 5 minutes and stores them in a database. WP Cron fires only on the page visit, so plugin may work incorrectly - to prevent such situations, you must disable WP Cron by adding %s to wp-config.php and adding a task to the system cron, for example: %s.', 'xmpp-statistics'), '<kbd style="font-size:smaller;">define(\'DISABLE_WP_CRON\', true);</kbd>', '<kbd style="font-size:smaller;">*/1 * * * * /usr/bin/php '.get_home_path().'wp-cron.php</kbd>'); ?></p>181 <p class="description"><?php printf(__('Automatically retrieves server statistics every 5 minutes and stores them in a database. WP Cron fires only on the page visit, so plugin may work incorrectly - to prevent such situations, you must disable WP Cron by adding %s to wp-config.php and adding a task to the system cron, for example: %s.', 'xmpp-statistics'), '<kbd>define(\'DISABLE_WP_CRON\', true);</kbd>', '<kbd>*/1 * * * * /usr/bin/php '.get_home_path().'wp-cron.php</kbd>'); ?></p> 163 182 </td> 164 183 </tr> … … 206 225 </tr> 207 226 </tbody></table> 208 </div> 209 <div id="major-publishing-actions"> 210 <div id="publishing-action"> 211 <input type="submit" name="submit" id="submit" class="button-primary" value="<?php _e('Save settings', 'xmpp-statistics'); ?>" /> 212 </div> 213 <div class="clear"></div> 214 </div> 215 </form> 216 </div> 227 </div> 228 </div> 229 <input type="submit" name="submit" id="submit" class="button-primary" value="<?php _e('Save settings', 'xmpp-statistics'); ?>" /> 230 </form> 217 231 </div> 218 232 </div> -
xmpp-statistics/trunk/uninstall.php
r3052196 r3176431 11 11 // Remove settings options 12 12 delete_option('xmpp_stats_rest_url'); 13 delete_option('xmpp_stats_login'); 14 delete_option('xmpp_stats_password'); 15 delete_option('xmpp_stats_oauth_token'); 13 16 delete_option('xmpp_stats_save_data'); 14 17 delete_option('xmpp_stats_delete_old_data'); 15 delete_option('xmpp_stats_login');16 delete_option('xmpp_stats_password');17 18 delete_option('xmpp_stats_chart_line_color'); 18 19 delete_option('xmpp_stats_chart_line_color2'); -
xmpp-statistics/trunk/xmpp-statistics.pot
r3102789 r3176431 3 3 msgstr "" 4 4 "Project-Id-Version: XMPP Statistics\n" 5 "POT-Creation-Date: 2024- 06-14 15:22+0200\n"5 "POT-Creation-Date: 2024-10-27 18:29+0100\n" 6 6 "PO-Revision-Date: 2019-09-12 15:34+0200\n" 7 7 "Last-Translator: \n" … … 12 12 "Content-Transfer-Encoding: 8bit\n" 13 13 "Plural-Forms: nplurals=2; plural=(n != 1);\n" 14 "X-Generator: Poedit 3. 4.4\n"14 "X-Generator: Poedit 3.5\n" 15 15 "X-Poedit-Basepath: .\n" 16 16 "X-Poedit-SourceCharset: UTF-8\n" … … 18 18 "X-Poedit-SearchPath-0: .\n" 19 19 20 #: includes/charts.php:52 includes/charts.php:181 includes/settings.php:3 5121 #: includes/settings.php:3 5220 #: includes/charts.php:52 includes/charts.php:181 includes/settings.php:365 21 #: includes/settings.php:366 22 22 msgid "Logged in users" 23 23 msgstr "" … … 25 25 #: includes/charts.php:52 includes/charts.php:297 includes/charts.php:494 26 26 #: includes/charts.php:689 includes/charts.php:884 includes/charts.php:1135 27 #: includes/charts.php:1386 includes/charts.php:1637 includes/settings.php:3 5128 #: includes/settings.php:3 53 includes/settings.php:35529 #: includes/settings.php:3 57 includes/settings.php:35930 #: includes/settings.php:3 61 includes/settings.php:36327 #: includes/charts.php:1386 includes/charts.php:1637 includes/settings.php:365 28 #: includes/settings.php:367 includes/settings.php:369 29 #: includes/settings.php:371 includes/settings.php:373 30 #: includes/settings.php:375 includes/settings.php:377 31 31 msgid "by day" 32 32 msgstr "" … … 58 58 #: includes/charts.php:181 includes/charts.php:396 includes/charts.php:591 59 59 #: includes/charts.php:786 includes/charts.php:1013 includes/charts.php:1264 60 #: includes/charts.php:1515 includes/charts.php:1766 includes/settings.php:3 5261 #: includes/settings.php:3 54 includes/settings.php:35662 #: includes/settings.php:3 58 includes/settings.php:36063 #: includes/settings.php:3 62 includes/settings.php:36460 #: includes/charts.php:1515 includes/charts.php:1766 includes/settings.php:366 61 #: includes/settings.php:368 includes/settings.php:370 62 #: includes/settings.php:372 includes/settings.php:374 63 #: includes/settings.php:376 includes/settings.php:378 64 64 msgid "by week" 65 65 msgstr "" 66 66 67 #: includes/charts.php:297 includes/charts.php:396 includes/settings.php:3 5368 #: includes/settings.php:3 5467 #: includes/charts.php:297 includes/charts.php:396 includes/settings.php:367 68 #: includes/settings.php:368 69 69 msgid "Registered users" 70 70 msgstr "" 71 71 72 #: includes/charts.php:494 includes/charts.php:591 includes/settings.php:3 3473 #: includes/settings.php:3 55 includes/settings.php:35672 #: includes/charts.php:494 includes/charts.php:591 includes/settings.php:348 73 #: includes/settings.php:369 includes/settings.php:370 74 74 msgid "XMPP server uptime" 75 75 msgstr "" 76 76 77 #: includes/charts.php:689 includes/charts.php:786 includes/settings.php:3 3678 #: includes/settings.php:3 57 includes/settings.php:35877 #: includes/charts.php:689 includes/charts.php:786 includes/settings.php:350 78 #: includes/settings.php:371 includes/settings.php:372 79 79 msgid "System uptime" 80 80 msgstr "" 81 81 82 #: includes/charts.php:884 includes/charts.php:1013 includes/settings.php:3 3783 #: includes/settings.php:3 59 includes/settings.php:36082 #: includes/charts.php:884 includes/charts.php:1013 includes/settings.php:351 83 #: includes/settings.php:373 includes/settings.php:374 84 84 msgid "RAM memory usage" 85 85 msgstr "" … … 95 95 msgstr "" 96 96 97 #: includes/charts.php:1386 includes/charts.php:1515 includes/settings.php:3 6198 #: includes/settings.php:3 6297 #: includes/charts.php:1386 includes/charts.php:1515 includes/settings.php:375 98 #: includes/settings.php:376 99 99 msgid "Outgoing S2S connections" 100 100 msgstr "" … … 105 105 msgstr "" 106 106 107 #: includes/charts.php:1637 includes/charts.php:1766 includes/settings.php:3 63108 #: includes/settings.php:3 64107 #: includes/charts.php:1637 includes/charts.php:1766 includes/settings.php:377 108 #: includes/settings.php:378 109 109 msgid "Incoming S2S connections" 110 110 msgstr "" … … 118 118 msgstr "" 119 119 120 #: includes/settings.php:2 8 includes/settings.php:134120 #: includes/settings.php:29 121 121 msgid "Settings" 122 122 msgstr "" 123 123 124 #: includes/settings.php:12 8124 #: includes/settings.php:129 125 125 msgid "XMPP server statistics" 126 126 msgstr "" 127 127 128 #: includes/settings.php:140 128 #: includes/settings.php:138 129 msgid "ReST API" 130 msgstr "" 131 132 #: includes/settings.php:143 129 133 msgid "API address" 130 134 msgstr "" 131 135 132 #: includes/settings.php:14 3136 #: includes/settings.php:146 133 137 msgid "Enter URL address defined for module mod_http_api in ejabberd settings." 134 138 msgstr "" 135 139 136 #: includes/settings.php:1 47140 #: includes/settings.php:150 137 141 msgid "Login" 138 142 msgstr "" 139 143 140 #: includes/settings.php:15 3144 #: includes/settings.php:156 141 145 msgid "Password" 142 146 msgstr "" 143 147 144 #: includes/settings.php:159 148 #: includes/settings.php:162 149 msgid "OAuth token" 150 msgstr "" 151 152 #: includes/settings.php:165 153 #, php-format 154 msgid "" 155 "Use instead of classic login and password access. The plugin doesn't " 156 "generate and check the expiration date of OAuth tokens, so you need to " 157 "generate OAuth token for your own with long expiration date. To generate a " 158 "token use the oauth_issue_token command with the ejabberdctl shell script e." 159 "g.: %s" 160 msgstr "" 161 162 #: includes/settings.php:173 163 msgid "Charts with statistics" 164 msgstr "" 165 166 #: includes/settings.php:178 145 167 msgid "Statistics" 146 168 msgstr "" 147 169 148 #: includes/settings.php:1 61170 #: includes/settings.php:180 149 171 msgid "Save statistics" 150 172 msgstr "" 151 173 152 #: includes/settings.php:1 62174 #: includes/settings.php:181 153 175 #, php-format 154 176 msgid "" … … 159 181 msgstr "" 160 182 161 #: includes/settings.php:1 66183 #: includes/settings.php:185 162 184 msgid "Cleaning" 163 185 msgstr "" 164 186 165 #: includes/settings.php:1 68187 #: includes/settings.php:187 166 188 msgid "Automatically delete unnecessary data from the database" 167 189 msgstr "" 168 190 169 #: includes/settings.php:1 69191 #: includes/settings.php:188 170 192 msgid "" 171 193 "Use this option with caution - it irrevocably removes data older than 2 " … … 173 195 msgstr "" 174 196 175 #: includes/settings.php:1 73197 #: includes/settings.php:192 176 198 msgid "Charts width" 177 199 msgstr "" 178 200 179 #: includes/settings.php:1 79201 #: includes/settings.php:198 180 202 msgid "Charts height" 181 203 msgstr "" 182 204 183 #: includes/settings.php: 185205 #: includes/settings.php:204 184 206 msgid "Charts lines color" 185 207 msgstr "" 186 208 187 #: includes/settings.php: 194209 #: includes/settings.php:213 188 210 msgid "Charts grid color" 189 211 msgstr "" 190 212 191 #: includes/settings.php:2 00213 #: includes/settings.php:219 192 214 msgid "Previous data in charts" 193 215 msgstr "" 194 216 195 #: includes/settings.php:2 03217 #: includes/settings.php:222 196 218 msgid "from yesterday" 197 219 msgstr "" 198 220 199 #: includes/settings.php:2 03221 #: includes/settings.php:222 200 222 msgid "from last week" 201 223 msgstr "" 202 224 203 #: includes/settings.php:2 04225 #: includes/settings.php:223 204 226 msgid "Specifies the data range for daily charts." 205 227 msgstr "" 206 228 207 #: includes/settings.php:2 11229 #: includes/settings.php:229 208 230 msgid "Save settings" 209 231 msgstr "" 210 232 211 #: includes/settings.php:2 23233 #: includes/settings.php:237 212 234 msgid "If you like this plugin please give a review at WordPress.org." 213 235 msgstr "" 214 236 215 #: includes/settings.php:2 29237 #: includes/settings.php:243 216 238 msgid "Usage information" 217 239 msgstr "" 218 240 219 #: includes/settings.php:2 35241 #: includes/settings.php:249 220 242 #, php-format 221 243 msgid "" … … 224 246 msgstr "" 225 247 226 #: includes/settings.php:2 36248 #: includes/settings.php:250 227 249 #, php-format 228 250 msgid "" … … 231 253 msgstr "" 232 254 233 #: includes/settings.php:2 55255 #: includes/settings.php:269 234 256 msgid "" 235 257 "Then configure ReST API url and authorization data, finally put shortcodes " … … 237 259 msgstr "" 238 260 239 #: includes/settings.php:2 56261 #: includes/settings.php:270 240 262 msgid "" 241 263 "For information about the system, use e.g. Nginx and Lua module. Plugin will " … … 244 266 msgstr "" 245 267 246 #: includes/settings.php:3 23268 #: includes/settings.php:337 247 269 msgid "Simple shortcodes" 248 270 msgstr "" 249 271 250 #: includes/settings.php:3 30272 #: includes/settings.php:344 251 273 msgid "Online users count" 252 274 msgstr "" 253 275 254 #: includes/settings.php:3 30 includes/settings.php:331255 #: includes/settings.php:3 32 includes/settings.php:333256 #: includes/settings.php:3 34 includes/settings.php:335276 #: includes/settings.php:344 includes/settings.php:345 277 #: includes/settings.php:346 includes/settings.php:347 278 #: includes/settings.php:348 includes/settings.php:349 257 279 msgid "Command" 258 280 msgstr "" 259 281 260 #: includes/settings.php:3 31282 #: includes/settings.php:345 261 283 msgid "Registered users count" 262 284 msgstr "" 263 285 264 #: includes/settings.php:3 32286 #: includes/settings.php:346 265 287 msgid "Outgoing s2s connections count" 266 288 msgstr "" 267 289 268 #: includes/settings.php:3 33290 #: includes/settings.php:347 269 291 msgid "Incoming s2s connections count" 270 292 msgstr "" 271 293 272 #: includes/settings.php:3 35294 #: includes/settings.php:349 273 295 msgid "XMPP server version" 274 296 msgstr "" 275 297 276 #: includes/settings.php:3 38298 #: includes/settings.php:352 277 299 msgid "System version" 278 300 msgstr "" 279 301 280 #: includes/settings.php:3 44302 #: includes/settings.php:358 281 303 msgid "Shortcodes for charts" 282 304 msgstr ""
Note: See TracChangeset
for help on using the changeset viewer.