68% wp-paymobile-content-locker

Code Review | WP PayMobile Content Locker

WordPress plugin WP PayMobile Content Locker scored68%from 54 tests.

About plugin

  • Plugin page: wp-paymobile-cont...
  • Plugin version: 1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.2.2
  • WordPress version: 6.3.1
  • First release: Apr 23, 2013
  • Latest release: Jul 9, 2015
  • Number of updates: 15
  • Update frequency: every 53.8 days
  • Top authors: crivion (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

10+ active /2,213 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.07MB] [CPU: ▼5.55ms] Passed 4 tests

Server-side resources used by WP PayMobile Content Locker
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0737.68 ▼0.32
Dashboard /wp-admin3.38 ▲0.0745.63 ▲0.74
Posts /wp-admin/edit.php3.43 ▲0.0743.25 ▼1.48
Add New Post /wp-admin/post-new.php5.96 ▲0.0777.68 ▼21.14
Media Library /wp-admin/upload.php3.30 ▲0.0740.59 ▲10.00
Statistics /wp-admin/admin.php?page=WP_PayMobile_Stats3.2731.64
WP PayMobile /wp-admin/admin.php?page=WP_PayMobile3.2630.46
Install Guide /wp-admin/admin.php?page=WP_PayMobile_Install3.2630.54

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 5 new files
Database: 1 new table, 10 new options
New tables
wp_paymobile
New WordPress options
widget_recent-comments
wp_paytoread_btnstyle
db_upgraded
wp_paytoread_msg
widget_theysaidso_widget
theysaidso_admin_options
wp_paytoread_currency
widget_recent-posts
can_compress_scripts
wp_paytoread_service

Browser metrics Passed 4 tests

Checking browser requirements for WP PayMobile Content Locker
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,819 ▲7314.25 ▼0.271.81 ▲0.2544.02 ▲2.49
Dashboard /wp-admin2,225 ▲515.53 ▼0.0787.35 ▲0.0576.14 ▲30.09
Posts /wp-admin/edit.php2,127 ▲271.99 ▼0.0238.28 ▲0.7334.22 ▼5.57
Add New Post /wp-admin/post-new.php1,704 ▲15522.39 ▲4.03667.46 ▲39.5357.10 ▼6.30
Media Library /wp-admin/upload.php1,430 ▲334.15 ▼0.0698.83 ▼0.4276.38 ▲34.26
Statistics /wp-admin/admin.php?page=WP_PayMobile_Stats9042.0326.8927.06
WP PayMobile /wp-admin/admin.php?page=WP_PayMobile9252.0424.5830.68
Install Guide /wp-admin/admin.php?page=WP_PayMobile_Install1,0041.9928.9132.57

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • Zombie tables detected upon uninstall: 1 table
    • wp_paymobile
  • This plugin did not uninstall successfully, leaving 10 options in the database
    • wp_paytoread_service
    • widget_recent-comments
    • widget_theysaidso_widget
    • wp_paytoread_btnstyle
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • wp_paytoread_msg
    • wp_paytoread_currency
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not 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
Please fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/wp-paymobile-content-locker/WP-PayMobile.php:23

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There are user-side issues you should fix
    • > GET request to /wp-admin/admin.php?page=WP_PayMobile_Stats
    • > Network (severe)
    wp-content/plugins/wp-paymobile-content-locker/assets/lock-icon.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=WP_PayMobile_Install
    • > Network (severe)
    wp-admin/assets/blueprint-css/screen.css - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=WP_PayMobile_Install
    • > Network (severe)
    wp-admin/assets/blueprint-css/plugins/fancy-type/screen.css - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=WP_PayMobile_Install
    • > Network (severe)
    wp-admin/assets/blueprint-css/print.css - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Stable tag: Not defined
You can take inspiration from this readme.txt

wp-paymobile-content-locker/WP-PayMobile.php 92% from 13 tests

The principal PHP file in "WP PayMobile Content Locker" v. 1.3 is loaded by WordPress automatically on each request
The following require your attention:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("wp-paymobile-content-locker.php" instead of "WP-PayMobile.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
Good job! No executable or dangerous file extensions detected394 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP18037314
HTML126280

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.32
Average class complexity32.00
▷ Minimum class complexity32.00
▷ Maximum class complexity32.00
Average method complexity3.82
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods11
▷ Static methods00.00%
▷ Public methods11100.00%
▷ Protected methods00.00%
▷ 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

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
2 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
lock-icon.png2.80KB1.40KB▼ 50.05%
lock.png2.03KB0.62KB▼ 69.32%