78% sp-announcement

Code Review | WP Announcement | Dynamic Announcement, Banner, & Countdown Timer for Effective Promotions

WordPress plugin WP Announcement | Dynamic Announcement, Banner, & Countdown Timer for Effective Promotions scored78%from 54 tests.

About plugin

  • Plugin page: sp-announcement
  • Plugin version: 2.0.2
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.4.1
  • WordPress version: 6.3.1
  • First release: Mar 28, 2023
  • Latest release: Nov 25, 2023
  • Number of updates: 9
  • Update frequency: every 26.9 days
  • Top authors: subscriptionpro (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /416 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.17MB] [CPU: ▼3.94ms] Passed 4 tests

Server-side resources used by WP Announcement | Dynamic Announcement, Banner, & Countdown Timer for Effective Promotions
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.66 ▲0.2041.05 ▼0.28
Dashboard /wp-admin3.48 ▲0.1346.98 ▼10.75
Posts /wp-admin/edit.php3.58 ▲0.2350.29 ▲4.71
Add New Post /wp-admin/post-new.php6.08 ▲0.1985.16 ▼5.96
Media Library /wp-admin/upload.php3.39 ▲0.1634.09 ▲1.23

Server storage [IO: ▲0.87MB] [DB: ▲0.00MB] Passed 3 tests

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 29 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by WP Announcement | Dynamic Announcement, Banner, & Countdown Timer for Effective Promotions
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,930 ▲16813.38 ▼0.988.65 ▲7.0837.75 ▼10.90
Dashboard /wp-admin2,226 ▲495.61 ▲0.0393.54 ▼0.9039.69 ▲4.03
Posts /wp-admin/edit.php2,131 ▲312.03 ▲0.0144.34 ▲3.3236.24 ▲0.63
Add New Post /wp-admin/post-new.php1,553 ▲2723.53 ▼0.05648.62 ▼46.9256.97 ▼4.24
Media Library /wp-admin/upload.php1,428 ▲314.22 ▲0.0698.23 ▲0.2843.66 ▲2.87

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% from 4 tests

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Good news, no errors were detected

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/sp-announcement/sp-announcement.php
  • 14× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Warning
      Use of undefined constant WPANN_PLUGIN_PATH - assumed 'WPANN_PLUGIN_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/sp-announcement/views/admin/announcement_meta_box.php on line 1
    • > PHP Warning
      Use of undefined constant WPANN_PLUGIN_PATH - assumed 'WPANN_PLUGIN_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/sp-announcement/includes/config/layout-options.php on line 7
    • > PHP Warning
      Use of undefined constant WPANN_PLUGIN_URL - assumed 'WPANN_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/sp-announcement/includes/config/layout-options.php on line 11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_the_ID() in wp-content/plugins/sp-announcement/views/templates/topbar_style_default.php:4
    • > PHP Warning
      Use of undefined constant WPANN_PLUGIN_URL - assumed 'WPANN_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/sp-announcement/includes/config/layout-options.php on line 45
    • > PHP Warning
      Use of undefined constant WPANN_PLUGIN_URL - assumed 'WPANN_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/sp-announcement/includes/config/layout-options.php on line 40
    • > PHP Fatal error
      require_once(): Failed opening required 'WPANN_PLUGIN_PATH/utils/dynamic-input-fields.php' (include_path='.:/usr/share/php') in wp-content/plugins/sp-announcement/views/admin/announcement_meta_box.php on line 1
    • > PHP Warning
      Use of undefined constant WPANN_PLUGIN_URL - assumed 'WPANN_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/sp-announcement/includes/config/layout-options.php on line 6
    • > PHP Warning
      Use of undefined constant WPANN_PLUGIN_URL - assumed 'WPANN_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/sp-announcement/includes/config/layout-options.php on line 30
    • > PHP Warning
      require_once(WPANN_PLUGIN_PATH/utils/dynamic-input-fields.php): failed to open stream: No such file or directory in wp-content/plugins/sp-announcement/views/admin/announcement_meta_box.php on line 1

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
7 plugin tags: countdown timer, banner, notification, sticky banner, announcement...

sp-announcement/sp-announcement.php 85% from 13 tests

"WP Announcement | Dynamic Announcement, Banner, & Countdown Timer for Effective Promotions" version 2.0.2's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please take the time to fix the following:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Description: Please keep the plugin description shorter than 140 characters (currently 172 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
No dangerous file extensions were detected1,616 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
PHP121251491,092
CSS1690342
JavaScript23035182

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity23.00
▷ Minimum class complexity11.00
▷ Maximum class complexity35.00
Average method complexity3.43
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods15
▷ Static methods960.00%
▷ Public methods15100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions240.00%
▷ Anonymous functions360.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
6 PNG files occupy 0.78MB with 0.49MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/banner_style_1_template.png569.86KB131.57KB▼ 76.91%
assets/images/icon-256x256.png67.10KB20.48KB▼ 69.48%
assets/images/topbar_style_3_template.png35.51KB14.93KB▼ 57.95%
assets/images/banner_style_2_template.png92.02KB33.02KB▼ 64.12%
assets/images/topbar_style_2_template.png11.47KB6.17KB▼ 46.25%