10% chargify

Code Review | WP-Chargify

WordPress plugin WP-Chargify scored10%from 54 tests.

About plugin

  • Plugin page: chargify
  • Plugin version: 2.1
  • PHP version: 7.4.16
  • WordPress compatibility: 2.9-5.1
  • WordPress version: 6.3.1
  • First release: Jan 30, 2011
  • Latest release: Mar 1, 2019
  • Number of updates: 42
  • Update frequency: every 70.3 days
  • Top authors: toddhuish (97.62%)vegasgeek (4.76%)

Code review

54 tests

User reviews

4 reviews

Install metrics

10+ active /4,587 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Please fix the following installer errors
  • The plugin did not install without errors
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method chargify::activate() should not be called statically

Server metrics [RAM: ▼0.98MB] [CPU: ▼46.09ms] Passed 4 tests

Server-side resources used by WP-Chargify
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.00 ▼0.4615.47 ▼28.53
Dashboard /wp-admin3.04 ▼0.2716.85 ▼38.26
Posts /wp-admin/edit.php3.04 ▼0.3221.11 ▼34.35
Add New Post /wp-admin/post-new.php3.04 ▼2.8520.32 ▼83.21
Media Library /wp-admin/upload.php3.04 ▼0.1919.48 ▼18.25

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 18 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
db_upgraded
chargify
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for WP-Chargify
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲4314.69 ▲0.161.60 ▼0.2442.48 ▼1.25
Dashboard /wp-admin2,198 ▲185.51 ▼0.3589.90 ▼3.5867.48 ▲28.55
Posts /wp-admin/edit.php2,115 ▲152.00 ▼0.0236.34 ▼1.0839.28 ▲0.62
Add New Post /wp-admin/post-new.php6,273 ▲4,74526.16 ▲3.12984.95 ▲296.3966.38 ▲11.40
Media Library /wp-admin/upload.php1,412 ▲124.28 ▲0.16103.28 ▼11.5067.92 ▲20.61

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
You still need to fix the following
  • Uninstall procedure had uncaught errors
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method chargify::subscriptionRedirect() should not be called statically
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments

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
Everything seems fine, however this is by no means an exhaustive test

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
Almost there! Just fix the following items
  • 5× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'ChargifyConnector' not found in wp-content/plugins/chargify/lib/ChargifySubscription.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'ChargifyConnector' not found in wp-content/plugins/chargify/lib/ChargifyCustomer.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'ChargifyConnector' not found in wp-content/plugins/chargify/lib/ChargifyProduct.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/chargify/chargify.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'ChargifyConnector' not found in wp-content/plugins/chargify/lib/ChargifyCreditCard.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
5 plugin tags: membership, chargify, registration, tools, subscription

chargify/chargify.php Passed 13 tests

The main PHP file in "WP-Chargify" ver. 2.1 adds more information about the plugin and also serves as the entry point for this plugin
56 characters long description:
Manage subscriptions to WordPress using the Chargify API

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Good job! No executable or dangerous file extensions detected1,402 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP62271041,373
JavaScript110429

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity36.33
▷ Minimum class complexity2.00
▷ Maximum class complexity189.00
Average method complexity3.28
▷ Minimum method complexity1.00
▷ Maximum method complexity31.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods93
▷ Static methods11.08%
▷ Public methods9197.85%
▷ Protected methods22.15%
▷ Private methods00.00%
Functions0
▷ Named functions00.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 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/chargify.png2.08KB0.47KB▼ 77.22%