84% courier-notices

Code Review | Courier Notices

WordPress plugin Courier Notices scored84%from 54 tests.

About plugin

  • Plugin page: courier-notices
  • Plugin version: 1.5.8
  • PHP compatiblity: 7.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.0.2
  • WordPress version: 6.3.1
  • First release: Jul 21, 2020
  • Latest release: Feb 22, 2023
  • Number of updates: 30
  • Update frequency: every 31.7 days
  • Top authors: aware (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /7,973 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: ▼7.42ms] Passed 4 tests

A check of server-side resources used by Courier Notices
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.66 ▲0.2045.49 ▼0.64
Dashboard /wp-admin3.48 ▲0.1357.26 ▼8.75
Posts /wp-admin/edit.php3.60 ▲0.2453.74 ▼9.02
Add New Post /wp-admin/post-new.php6.07 ▲0.1995.45 ▼11.26
Media Library /wp-admin/upload.php3.39 ▲0.1747.49 ▲4.64
Add New /wp-admin/post-new.php?post_type=courier_notice3.5569.49
All Notices /wp-admin/edit.php?post_type=courier_notice3.5054.01
Settings /wp-admin/edit.php?post_type=courier_notice&page=courier3.4439.16

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 137 new files
Database: no new tables, 8 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
widget_recent-posts
courier_notices_options
courier_notices_design
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for Courier Notices
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,932 ▲17113.61 ▼0.7615.63 ▲13.6737.27 ▼8.10
Dashboard /wp-admin2,229 ▲525.60 ▼0.0186.50 ▼11.8339.76 ▼8.71
Posts /wp-admin/edit.php2,142 ▲422.01 ▲0.0233.79 ▼1.4439.33 ▲0.13
Add New Post /wp-admin/post-new.php1,562 ▲3617.45 ▼0.02647.47 ▼82.1450.94 ▼1.59
Media Library /wp-admin/upload.php1,434 ▲314.12 ▼0.11103.31 ▼2.1148.22 ▲4.04
Add New /wp-admin/post-new.php?post_type=courier_notice2,4527.89178.5973.22
All Notices /wp-admin/edit.php?post_type=courier_notice1,4902.3439.0839.17
Settings /wp-admin/edit.php?post_type=courier_notice&page=courier1,2172.4231.6347.67

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
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 8 options in the database
    • db_upgraded
    • courier_notices_options
    • widget_recent-posts
    • widget_recent-comments
    • courier_notices_design
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 19× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Notice
      Undefined variable: notice_class in wp-content/plugins/courier-notices/templates/notice-popup-modal.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/courier-notices/templates/admin/upgrade-notice.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_term_meta() in wp-content/plugins/courier-notices/templates/admin/notice-preview.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function status_header() in wp-content/plugins/courier-notices/uninstall.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/courier-notices/templates/admin/notifications.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/courier-notices/templates/admin/js/courier-notice-type-row.php:15
    • > PHP Notice
      Undefined variable: type in wp-content/plugins/courier-notices/templates/admin/notifications.php on line 6
    • > PHP Fatal error
      Uncaught Error: Class 'WP_REST_Controller' not found in wp-content/plugins/courier-notices/src/Controller/Courier_REST_Controller.php:17
    • > PHP Notice
      Undefined variable: notice_class in wp-content/plugins/courier-notices/templates/notice-informational.php on line 2
    • > PHP Notice
      Undefined variable: notice_class in wp-content/plugins/courier-notices/templates/notice.php on line 2

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 Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
7 plugin tags: notifications, dismissible, alerts, gdpr, front end...

courier-notices/courier-notices.php Passed 13 tests

The principal PHP file in "Courier Notices" v. 1.5.8 is loaded by WordPress automatically on each request
94 characters long description:
A way to display, manage, and control front end user notifications for your WordPress install.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
No dangerous file extensions were detected11,743 lines of code in 95 files:
LanguageFilesBlank linesComment linesLines of code
PHP772,4553,5677,613
CSS32111333,250
SVG8846459
Markdown41640360
JSON10059
JavaScript2002

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity20.12
▷ Minimum class complexity1.00
▷ Maximum class complexity186.00
Average method complexity3.35
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces13
Interfaces0
Traits0
Classes40
▷ Abstract classes12.50%
▷ Concrete classes3997.50%
▷ Final classes00.00%
Methods327
▷ Static methods4212.84%
▷ Public methods24274.01%
▷ Protected methods7021.41%
▷ Private methods154.59%
Functions36
▷ Named functions3391.67%
▷ Anonymous functions38.33%
Constants8
▷ Global constants787.50%
▷ Class constants112.50%
▷ Public constants1100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
19 PNG files occupy 3.57MB with 2.22MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/courier-logo-fullcolor.png10.39KB5.29KB▼ 49.07%
img/courier-logo-fullcolor@2x.png22.45KB11.38KB▼ 49.30%
img/courier-logo-mark.png7.63KB3.38KB▼ 55.67%
img/courier-settings-banner.png247.88KB31.84KB▼ 87.15%
img/courier-promo-background-728x90.png36.92KB11.17KB▼ 69.73%