78% lh-agree-to-terms

Code Review | = LH Agree to Terms

WordPress plugin = LH Agree to Terms scored78%from 54 tests.

About plugin

  • Plugin page: lh-agree-to-terms
  • Plugin version: 1.25
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.9
  • WordPress version: 6.3.1
  • First release: May 3, 2016
  • Latest release: Jun 8, 2018
  • Number of updates: 24
  • Update frequency: every 95.4 days
  • Top authors: shawfactor (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

1,000+ active /9,803 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
Installer ran successfully

Server metrics [RAM: ▲0.08MB] [CPU: ▼2.45ms] Passed 4 tests

An overview of server-side resources used by = LH Agree to Terms
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0846.44 ▲3.57
Dashboard /wp-admin3.38 ▲0.0849.09 ▼7.09
Posts /wp-admin/edit.php3.50 ▲0.1454.13 ▲3.44
Add New Post /wp-admin/post-new.php5.97 ▲0.0795.87 ▼9.40
Media Library /wp-admin/upload.php3.31 ▲0.0741.07 ▲3.26
Agree to terms /wp-admin/options-general.php?page=lh-agree-to-terms/lh-agree-to-terms.php3.2933.49

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

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

Browser metrics Passed 4 tests

= LH Agree to Terms: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.34 ▲0.061.74 ▼0.0644.51 ▲3.90
Dashboard /wp-admin2,199 ▲225.58 ▼0.0891.47 ▲2.4642.30 ▼1.38
Posts /wp-admin/edit.php2,107 ▲71.99 ▲0.0240.87 ▼3.9132.70 ▼1.96
Add New Post /wp-admin/post-new.php1,529 ▼823.53 ▲5.32701.01 ▲52.3358.16 ▼17.39
Media Library /wp-admin/upload.php1,407 ▲44.13 ▼0.0695.17 ▼10.3741.43 ▼7.68
Agree to terms /wp-admin/options-general.php?page=lh-agree-to-terms/lh-agree-to-terms.php8412.0324.3028.13

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These server-side errors were triggered
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=lh-agree-to-terms/lh-agree-to-terms.php
    • > Notice in wp-content/plugins/lh-agree-to-terms/partials/option-settings.php+62
    Trying to access array offset on value of type bool

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following items
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/lh-agree-to-terms/partials/option-settings.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/lh-agree-to-terms/lh-agree-to-terms.php:469

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
5 plugin tags: terms, conditions, require, agree, privacy

lh-agree-to-terms/lh-agree-to-terms.php 92% from 13 tests

The primary PHP file in "= LH Agree to Terms" version 1.25 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Text Domain: The text domain should only use lowercase characters and dashes

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Good job! No executable or dangerous file extensions detected294 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP227441283
JavaScript19011

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.52
Average class complexity68.00
▷ Minimum class complexity68.00
▷ Maximum class complexity68.00
Average method complexity4.69
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods17
▷ Static methods15.88%
▷ Public methods1376.47%
▷ Protected methods15.88%
▷ Private methods317.65%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.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
No PNG files were detected