74% magicsubscriptions

Code Review | Magic Subscriptions

WordPress plugin Magic Subscriptions scored74%from 54 tests.

About plugin

  • Plugin page: magicsubscriptions
  • Plugin version: 0.19.13
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-5.4.1
  • WordPress version: 6.3.1
  • First release: Dec 13, 2019
  • Latest release: Nov 5, 2021
  • Number of updates: 54
  • Update frequency: every 12.9 days
  • Top authors: ronniebarker (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /715 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▼0.62MB] [CPU: ▼32.88ms] Passed 4 tests

Server-side resources used by Magic Subscriptions
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.74 ▲0.2727.30 ▼16.81
Dashboard /wp-admin3.33 ▲0.0227.79 ▼24.60
Posts /wp-admin/edit.php3.33 ▼0.0325.95 ▼23.59
Add New Post /wp-admin/post-new.php3.33 ▼2.5623.55 ▼66.52
Media Library /wp-admin/upload.php3.33 ▲0.1027.82 ▼11.77

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 32 new files
Database: no new tables, 11 new options
New WordPress options
db_upgraded
can_compress_scripts
widget_magicsubscriptions-plans
widget_recent-comments
widget_theysaidso_widget
widget_magicsubscriptions-summary
widget_magicsubscriptions-shop
theysaidso_admin_options
widget_magicsubscriptions-connect
widget_recent-posts
...

Browser metrics Passed 4 tests

Magic Subscriptions: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,997 ▲23615.88 ▲1.278.99 ▲7.0671.45 ▲26.42
Dashboard /wp-admin2,238 ▲586.02 ▲0.35108.19 ▲5.4038.84 ▼14.86
Posts /wp-admin/edit.php2,130 ▲303.02 ▲1.0045.72 ▲2.7638.52 ▲2.05
Add New Post /wp-admin/post-new.php6,367 ▲4,83928.18 ▲4.84806.06 ▲128.6639.17 ▼16.84
Media Library /wp-admin/upload.php1,452 ▲525.49 ▲1.40100.47 ▼12.7043.08 ▼4.35
Magic Subscriptions /wp-admin/options-general.php?page=Set up Magic Subscriptions integration8792.5734.1525.18

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • Uninstall procedure validation failed for this plugin
    • > User deprecated in wp-includes/functions.php+5737
    Function has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.
  • This plugin did not uninstall successfully, leaving 11 options in the database
    • widget_magicsubscriptions-shop
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_magicsubscriptions-connect
    • widget_magicsubscriptions-summary
    • widget_magicsubscriptions-widesummary
    • can_compress_scripts
    • ...

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/magicsubscriptions/Utilities/FontAwesome.php:25
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/magicsubscriptions/Admin/Options.php:30

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
No plugin tags provided

magicsubscriptions/MagicSubscriptions.php 92% from 13 tests

The main PHP script in "Magic Subscriptions" version 0.19.13 is automatically included on every request by WordPress
It is important to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("magicsubscriptions.php" instead of "MagicSubscriptions.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected2,192 lines of code in 29 files:
LanguageFilesBlank linesComment linesLines of code
PHP195683681,276
CSS531788712
JavaScript55189204

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity5.93
▷ Minimum class complexity1.00
▷ Maximum class complexity14.00
Average method complexity2.07
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes14
▷ Abstract classes00.00%
▷ Concrete classes14100.00%
▷ Final classes00.00%
Methods65
▷ Static methods57.69%
▷ Public methods5584.62%
▷ Protected methods00.00%
▷ Private methods1015.38%
Functions23
▷ Named functions1147.83%
▷ Anonymous functions1252.17%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1 PNG file occupies 0.15MB with 0.10MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
Logo.png154.55KB53.79KB▼ 65.20%