83% mws-click-to-reveal

Code Review | MWS Click-to-reveal

WordPress plugin MWS Click-to-reveal scored83%from 54 tests.

About plugin

  • Plugin page: mws-click-to-reveal
  • Plugin version: 1.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.9
  • WordPress version: 6.3.1
  • First release: Nov 1, 2017
  • Latest release: Oct 14, 2018
  • Number of updates: 6
  • Update frequency: every 58.2 days
  • Top authors: modernwebservices (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /616 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.18MB] [CPU: ▼5.40ms] Passed 4 tests

An overview of server-side resources used by MWS Click-to-reveal
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.60 ▲0.1441.86 ▼0.96
Dashboard /wp-admin3.54 ▲0.2351.41 ▼5.07
Posts /wp-admin/edit.php3.59 ▲0.2350.02 ▼4.30
Add New Post /wp-admin/post-new.php6.06 ▲0.1798.16 ▼11.26
Media Library /wp-admin/upload.php3.40 ▲0.1742.78 ▲5.22
Integration /wp-admin/admin.php?page=mws_click_to_reveal_credentials3.3631.56
Click-to-reveal /wp-admin/admin.php?page=mws_click_to_reveal3.3636.55

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 27 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options
widget_recent-comments
mws_click_to_reveal_settings

Browser metrics Passed 4 tests

This is an overview of browser requirements for MWS Click-to-reveal
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,816 ▲5514.60 ▲0.251.61 ▲0.1841.31 ▲0.92
Dashboard /wp-admin2,222 ▲455.63 ▼0.0392.67 ▲1.9839.37 ▼2.71
Posts /wp-admin/edit.php2,127 ▲271.99 ▼0.0439.37 ▲3.4836.03 ▲3.58
Add New Post /wp-admin/post-new.php1,548 ▲2023.08 ▼0.00622.66 ▲3.7158.31 ▼4.60
Media Library /wp-admin/upload.php1,421 ▲214.22 ▲0.0399.56 ▼8.9947.24 ▲0.27
Integration /wp-admin/admin.php?page=mws_click_to_reveal_credentials8202.0024.6725.26
Click-to-reveal /wp-admin/admin.php?page=mws_click_to_reveal9322.0223.7525.25

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • This plugin does not fully uninstall, leaving 7 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • mws_click_to_reveal_settings
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% 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
Please fix the following items
  • 5× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught TypeError: extract() expects parameter 1 to be array, null given in wp-content/plugins/mws-click-to-reveal/src/templates/admin/protected_values.php:15
    • > PHP Fatal error
      Uncaught TypeError: extract() expects parameter 1 to be array, null given in wp-content/plugins/mws-click-to-reveal/src/templates/admin/recaptcha_credentials.php:13
    • > PHP Notice
      Undefined variable: siteKey in wp-content/plugins/mws-click-to-reveal/src/templates/admin/recaptcha_credentials_display.php on line 13
    • > PHP Fatal error
      Uncaught Error: Class 'ModernWebServices\\Plugins\\ClickToReveal\\Pages\\Admin\\CredentialsPage' not found in wp-content/plugins/mws-click-to-reveal/src/templates/admin/recaptcha_credentials_display.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/mws-click-to-reveal/src/templates/admin/recaptcha_credentials_input.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that need to be fixed:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === mws-click-to-reveal === )
The official readme.txt is a good inspiration

mws-click-to-reveal/recaptcha-click-to-reveal.php 77% from 13 tests

This is the main PHP file of "MWS Click-to-reveal" version 1.0.3, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important to fix the following:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Domain Path: The domain path points to a folder that does not exist ("/languages")
  • Main file name: Name the main plugin file the same as the plugin slug ("mws-click-to-reveal.php" instead of "recaptcha-click-to-reveal.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin1,271 lines of code in 24 files:
LanguageFilesBlank linesComment linesLines of code
PHP202714681,102
JavaScript33767168
JSON1001

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity12.20
▷ Minimum class complexity1.00
▷ Maximum class complexity44.00
Average method complexity2.35
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces4
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods84
▷ Static methods55.95%
▷ Public methods6172.62%
▷ Protected methods00.00%
▷ Private methods2327.38%
Functions2
▷ Named functions150.00%
▷ Anonymous functions150.00%
Constants24
▷ Global constants00.00%
▷ Class constants24100.00%
▷ Public constants24100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG images were found in this plugin