68% pagely-reseller-management

Code Review | Integration Plugin for Pagely Resellers

WordPress plugin Integration Plugin for Pagely Resellers scored 68% from 54 tests.

About plugin

  • Plugin page: pagely-reseller-m...
  • Plugin version: 3.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4-3.9
  • WordPress version: 5.9.2
  • First release: Oct 7, 2009
  • Latest release: Jun 3, 2014
  • Number of updates: 83
  • Update frequency: every 20.5 days
  • Top authors: joshua.strebel (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 4,794 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▼1.98MB] [CPU: ▼342.86ms] Passed 4 tests

Analyzing server-side resources used by Integration Plugin for Pagely Resellers
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.36 ▼1.1516.66 ▼36.60
Dashboard /wp-admin2.41 ▼0.9910.34 ▼22.25
Posts /wp-admin/edit.php2.41 ▼1.2210.00 ▼39.34
Add New Post /wp-admin/post-new.php2.41 ▼4.5610.05 ▼1,273.24
Media Library /wp-admin/upload.php2.41 ▼0.8810.23 ▼21.56

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 25 new files
Database: no new tables, 1 new option
New WordPress options
pp_api

Browser metrics Passed 4 tests

Integration Plugin for Pagely Resellers: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,695 ▼4913.98 ▼1.786.17 ▼0.702.62 ▲0.64
Dashboard /wp-admin2,898 ▲376.01 ▼0.15119.33 ▼15.92163.95 ▼3.78
Posts /wp-admin/edit.php2,705 ▲143.24 ▲0.0167.89 ▼25.40146.94 ▼0.67
Add New Post /wp-admin/post-new.php1,638 ▼12221.07 ▼0.93433.01 ▼51.67164.17 ▲3.60
Media Library /wp-admin/upload.php1,718 ▲205.54 ▲0.07141.57 ▼5.80195.24 ▲7.33

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • Uninstall procedure had uncaught errors
    • > Warning in wp-content/plugins/pagely-reseller-management/partner-api.php+101
    Use of undefined constant PAGELY_PARTNER_API_SECRET - assumed 'PAGELY_PARTNER_API_SECRET' (this will throw an Error in a future version of PHP)
  • This plugin does not fully uninstall, leaving 1 option in the database
    • pp_api

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP 0% 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
Almost there! Just fix the following items
  • 4× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/pagely-reseller-management/views/offline.php
    • > /wp-content/plugins/pagely-reseller-management/views/misfire.php
    • > /wp-content/plugins/pagely-reseller-management/views/order_step2.php
    • > /wp-content/plugins/pagely-reseller-management/views/complete.php
  • 9× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/pagely-reseller-management/views/order_step3.php:6
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/pagely-reseller-management/views/order-form.php:41
    • > PHP Warning
      Use of undefined constant WP_CONTENT_DIR - assumed 'WP_CONTENT_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/pagely-reseller-management/partner-api.php on line 63
    • > PHP Warning
      Use of undefined constant PP_PLUGIN_ASSETS - assumed 'PP_PLUGIN_ASSETS' (this will throw an Error in a future version of PHP) in wp-content/plugins/pagely-reseller-management/views/options-page.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'PagelyApi' not found in wp-content/plugins/pagely-reseller-management/inc/options_page.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/pagely-reseller-management/partner-api.php:66
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/pagely-reseller-management/views/options-page.php:4
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/pagely-reseller-management/views/cart.php:2
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/pagely-reseller-management/views/order_step1.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that require attention:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === pagely-reseller-management === )
You can take inspiration from this readme.txt

pagely-reseller-management/partner-api.php 92% from 13 tests

The main PHP file in "Integration Plugin for Pagely Resellers" ver. 3.3 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("pagely-reseller-management.php" instead of "partner-api.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin1,810 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP123884641,224
JavaScript343162518
CSS110968

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity69.00
▷ Minimum class complexity43.00
▷ Maximum class complexity95.00
Average method complexity3.57
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods53
▷ Static methods11.89%
▷ Public methods53100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
5 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/gfx/error.png0.65KB0.68KB0.00%
assets/gfx/paypal.png3.03KB2.10KB▼ 30.66%
assets/gfx/pagely-api-small.png6.20KB3.59KB▼ 42.17%
assets/gfx/stripe_bg.png0.55KB0.34KB▼ 37.72%
assets/gfx/accept.png0.92KB0.81KB▼ 12.11%