64% pay-to-post

Code Review | Pay To Post

WordPress plugin Pay To Post scored64%from 54 tests.

About plugin

  • Plugin page: pay-to-post
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.0-4.3
  • WordPress version: 6.3.1
  • First release: Sep 8, 2015
  • Latest release: Sep 8, 2015
  • Number of updates: 2
  • Update frequency: every 0.5 days
  • Top authors: PluginCentral (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

10+ active /2,605 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.15MB] [CPU: ▼5.22ms] Passed 4 tests

An overview of server-side resources used by Pay To Post
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.62 ▲0.1541.49 ▲0.71
Dashboard /wp-admin3.45 ▲0.1548.85 ▼1.18
Posts /wp-admin/edit.php3.57 ▲0.2153.99 ▼0.39
Add New Post /wp-admin/post-new.php6.05 ▲0.1789.10 ▼14.63
Media Library /wp-admin/upload.php3.38 ▲0.1539.85 ▼4.67
Pay To Post /wp-admin/options-general.php?page=pay_to_post_menu3.3937.14

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 19 new files
Database: 2 new tables, 6 new options
New tables
wp_ptp_paypal_transactions
wp_ptp_local_transactions
New WordPress options
widget_recent-posts
widget_recent-comments
can_compress_scripts
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Pay To Post
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,880 ▲11913.47 ▼1.157.82 ▲6.1843.32 ▼0.80
Dashboard /wp-admin2,203 ▲265.66 ▼0.0288.35 ▲1.4238.82 ▼4.01
Posts /wp-admin/edit.php2,108 ▲82.02 ▼0.0339.38 ▼1.8035.66 ▼5.58
Add New Post /wp-admin/post-new.php1,533 ▼1217.48 ▼5.57669.02 ▲50.1967.43 ▲13.01
Media Library /wp-admin/upload.php1,411 ▲114.16 ▲0.00115.79 ▲1.0548.46 ▲2.18
Pay To Post /wp-admin/options-general.php?page=pay_to_post_menu1,3152.0926.9234.23

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
Please fix the following items
  • The plugin did not uninstall successfully, leaving 2 tables in the database
    • wp_ptp_paypal_transactions
    • wp_ptp_local_transactions
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting 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
  • 20× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Warning
      require_once(ABS_PATHfunctions/ptp-options.php): failed to open stream: No such file or directory in wp-content/plugins/pay-to-post/functions/ptp-database.php on line 5
    • > PHP Warning
      require_once(ABS_PATHfunctions/ptp-functions.php): failed to open stream: No such file or directory in wp-content/plugins/pay-to-post/pages/payment-page.php on line 5
    • > PHP Warning
      Use of undefined constant ABS_PATH - assumed 'ABS_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/pay-to-post/functions/ptp-database.php on line 5
    • > PHP Warning
      Use of undefined constant ABS_PATH - assumed 'ABS_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/pay-to-post/functions/ptp-options.php on line 5
    • > PHP Fatal error
      require_once(): Failed opening required 'ABS_PATHfunctions/ptp-functions.php' (include_path='.:/usr/share/php') in wp-content/plugins/pay-to-post/pages/payment-page.php on line 5
    • > PHP Warning
      Use of undefined constant ABS_PATH - assumed 'ABS_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/pay-to-post/pages/payment-page.php on line 5
    • > PHP Warning
      Use of undefined constant ABS_PATH - assumed 'ABS_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/pay-to-post/pages/confirmation-page.php on line 5
    • > PHP Fatal error
      require_once(): Failed opening required 'ABS_PATHfunctions/ptp-options.php' (include_path='.:/usr/share/php') in wp-content/plugins/pay-to-post/functions/ptp-functions.php on line 5
    • > PHP Warning
      Use of undefined constant ABS_PATH - assumed 'ABS_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/pay-to-post/pages/transactions-page.php on line 5
    • > PHP Warning
      require_once(ABS_PATHfunctions/ptp-database.php): failed to open stream: No such file or directory in wp-content/plugins/pay-to-post/pages/transactions-page.php on line 5

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that need to be fixed:
  • Plugin Name: You should set the name of your plugin on the first line ( === pay-to-post === )
  • Donate link: Invalid url: "www.paytopost-plugin.com/donate/"
The official readme.txt might help

pay-to-post/pay-to-post.php Passed 13 tests

"Pay To Post" version 1.0.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
70 characters long description:
A plugin to allow administrators to charge users for posting to a site

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
It is important to fix the following items
  • Do not distribute dangerous files with your plugin
    • .bat - Batch File in Windows
      • wp-content/plugins/pay-to-post/sassbuild.bat
1,021 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
PHP922958854
JavaScript1341588
Sass17246
CSS26132
DOS Batch1001

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity7.38
▷ Minimum class complexity1.00
▷ Maximum class complexity22.00
Average method complexity2.07
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods48
▷ Static methods2245.83%
▷ Public methods3981.25%
▷ Protected methods00.00%
▷ Private methods918.75%
Functions4
▷ Named functions00.00%
▷ Anonymous functions4100.00%
Constants12
▷ Global constants325.00%
▷ Class constants975.00%
▷ Public constants9100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG files were detected