83% upcoming-subscription-reports

Code Review | Upcoming subscription Reports

WordPress plugin Upcoming subscription Reports scored83%from 54 tests.

About plugin

  • Plugin page: upcoming-subscrip...
  • Plugin version: 1.0.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.2
  • WordPress version: 6.3.1
  • First release: Dec 16, 2021
  • Latest release: May 4, 2023
  • Number of updates: 6
  • Update frequency: every 84.3 days
  • Top authors: saliya22 (66.67%)storepro (50%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /299 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.01MB] [CPU: ▼7.89ms] Passed 4 tests

Server-side resources used by Upcoming subscription Reports
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0041.88 ▲0.14
Dashboard /wp-admin3.31 ▼0.0448.53 ▼16.31
Posts /wp-admin/edit.php3.36 ▲0.0053.29 ▼0.76
Add New Post /wp-admin/post-new.php5.89 ▲0.0088.34 ▼14.21
Media Library /wp-admin/upload.php3.23 ▲0.0036.02 ▼0.27

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 24 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for Upcoming subscription Reports
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲5314.34 ▼0.022.19 ▲0.5445.12 ▲0.76
Dashboard /wp-admin2,198 ▲185.61 ▼0.0586.02 ▼6.5840.26 ▲0.68
Posts /wp-admin/edit.php2,100 ▼02.02 ▲0.0440.47 ▲1.1335.73 ▲0.54
Add New Post /wp-admin/post-new.php1,534 ▲818.52 ▼4.56607.24 ▼31.6675.31 ▲13.27
Media Library /wp-admin/upload.php1,394 ▼94.21 ▼0.00101.75 ▲1.5243.63 ▼2.06

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
These items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however 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
  • 14× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'UPSRBaseController' not found in wp-content/plugins/upcoming-subscription-reports/inc/base/upcoming-subscription-report-enqueue.php:11
    • > PHP Warning
      require_once(UPSR_PLUGIN_DIRinc/api/callbacks/upcoming-subscription-report-admin-post-filter.php): failed to open stream: No such file or directory in wp-content/plugins/upcoming-subscription-reports/inc/api/callbacks/upcoming-subscription-report-admin-callbacks.php on line 11
    • > PHP Fatal error
      require(): Failed opening required 'UPSR_PLUGIN_DIRinc/api/upcoming-subscription-report-api.php' (include_path='.:/usr/share/php') in wp-content/plugins/upcoming-subscription-reports/inc/pages/upcoming-subscription-report-admin.php on line 7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/upcoming-subscription-reports/woocommerce-upcoming-subscription-report.php:20
    • > PHP Fatal error
      require_once(): Failed opening required 'UPSR_PLUGIN_DIRinc/api/callbacks/upcoming-subscription-report-admin-post-filter.php' (include_path='.:/usr/share/php') in wp-content/plugins/upcoming-subscription-reports/inc/api/callbacks/upcoming-subscription-report-admin-callbacks.php on line 11
    • > PHP Warning
      Use of undefined constant UPSR_PLUGIN_DIR - assumed 'UPSR_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/upcoming-subscription-reports/inc/pages/upcoming-subscription-report-admin.php on line 7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/upcoming-subscription-reports/inc/api/callbacks/upcoming-subscription-report-admin-post-filter.php:11
    • > PHP Fatal error
      require(): Failed opening required 'UPSR_PLUGIN_DIRinc/base/upcoming-subscription-report-base-controller.php' (include_path='.:/usr/share/php') in wp-content/plugins/upcoming-subscription-reports/inc/init.php on line 9
    • > PHP Warning
      Use of undefined constant UPSR_PLUGIN_DIR - assumed 'UPSR_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/upcoming-subscription-reports/inc/api/callbacks/upcoming-subscription-report-admin-callbacks.php on line 11
    • > PHP Fatal error
      Uncaught Error: Class 'UPSRBaseController' not found in wp-content/plugins/upcoming-subscription-reports/inc/base/upcoming-subscription-report-settings-links.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
6 plugin tags: upcoming subscriptions reports, woocommerce subscriptions, woocommerce, reports subscriptions, subscriptions report live filter...

upcoming-subscription-reports/woocommerce-upcoming-subscription-report.php 77% from 13 tests

"Upcoming subscription Reports" version 1.0.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("upcoming-subscription-reports.php" instead of "woocommerce-upcoming-subscription-report.php")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Description: Keep the plugin description shorter than 140 characters (currently 147 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected926 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
PHP15216147501
JavaScript22617227
CSS25411198

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity3.82
▷ Minimum class complexity1.00
▷ Maximum class complexity12.00
Average method complexity1.97
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes11
▷ Abstract classes00.00%
▷ Concrete classes11100.00%
▷ Final classes19.09%
Methods32
▷ Static methods515.62%
▷ Public methods3196.88%
▷ Protected methods00.00%
▷ Private methods13.12%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
4 PNG files occupy 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/renew-logo-main-cropped.png4.40KB2.11KB▼ 52.14%
assets/images/storepro-og.png4.74KB2.43KB▼ 48.74%
assets/images/storepro-logo.png1.62KB1.86KB0.00%
assets/images/storepro-white.png3.63KB2.09KB▼ 42.55%