84% pronamic-subscriptions

Code Review | Pronamic Subscriptions

WordPress plugin Pronamic Subscriptions scored84%from 54 tests.

About plugin

  • Plugin page: pronamic-subscrip...
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-3.9.1
  • WordPress version: 6.3.1
  • First release: Nov 24, 2012
  • Latest release: Jul 21, 2014
  • Number of updates: 13
  • Update frequency: every 60.2 days
  • Top authors: remcotolsma (61.54%)pronamic (46.15%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,251 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼4.21ms] Passed 4 tests

Analyzing server-side resources used by Pronamic Subscriptions
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0341.10 ▼0.52
Dashboard /wp-admin3.34 ▲0.0348.93 ▼9.30
Posts /wp-admin/edit.php3.39 ▲0.0347.53 ▼0.98
Add New Post /wp-admin/post-new.php5.92 ▲0.0487.45 ▼6.02
Media Library /wp-admin/upload.php3.26 ▲0.0344.93 ▲5.98
Add New /wp-admin/post-new.php?post_type=pronamic_subs3.4153.87
Subscriptions /wp-admin/edit.php?post_type=pronamic_subs3.3040.21

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Pronamic Subscriptions
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,818 ▲5714.55 ▼0.071.84 ▲0.2643.69 ▲2.05
Dashboard /wp-admin2,224 ▲475.66 ▲0.0687.33 ▼4.2873.68 ▲31.96
Posts /wp-admin/edit.php2,129 ▲321.99 ▼0.1640.35 ▲3.5435.13 ▼1.52
Add New Post /wp-admin/post-new.php1,702 ▲17622.24 ▼1.27696.41 ▼0.8157.33 ▼8.40
Media Library /wp-admin/upload.php1,417 ▲174.18 ▲0.05104.34 ▼1.2474.63 ▲26.87
Add New /wp-admin/post-new.php?post_type=pronamic_subs2,4997.68192.19127.74
Subscriptions /wp-admin/edit.php?post_type=pronamic_subs1,1341.9235.5631.84

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • 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
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following items
  • 5× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/pronamic-subscriptions/admin/meta-box-subscription-capabilities.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/pronamic-subscriptions/includes/gravityforms.php:23
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/pronamic-subscriptions/admin/meta-box-subscription-details.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_the_ID() in wp-content/plugins/pronamic-subscriptions/admin/meta-box-subscription.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/pronamic-subscriptions/pronamic-subscriptions.php:45

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
2 plugin tags: companies, pronamic

pronamic-subscriptions/pronamic-subscriptions.php 92% from 13 tests

"Pronamic Subscriptions" version 1.0.2's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Text Domain: The text domain follows the same naming rules as the plugin slug: lowercase characters and dashes

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 detected529 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP6138169379
PO File14211,07398
SQL30052

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity15.50
▷ Minimum class complexity15.00
▷ Maximum class complexity16.00
Average method complexity2.71
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods17
▷ Static methods1164.71%
▷ Public methods1694.12%
▷ Protected methods00.00%
▷ Private methods15.88%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
admin/icons/subscription.png0.67KB0.58KB▼ 13.33%