84% force-to-terms-conditions

Code Review | Force To Terms & Conditions

WordPress plugin Force To Terms & Conditions scored 84% from 54 tests.

About plugin

  • Plugin page: force-to-terms-co...
  • Plugin version: 2.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.8
  • WordPress version: 6.3.1
  • First release: Aug 26, 2017
  • Latest release: Aug 23, 2021
  • Number of updates: 6
  • Update frequency: every 243.2 days
  • Top authors: anasbinmukim (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 845 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼2.15ms] Passed 4 tests

This is a short check of server-side resources used by Force To Terms & Conditions
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0439.55 ▲0.84
Dashboard /wp-admin3.33 ▲0.0264.27 ▲15.82
Posts /wp-admin/edit.php3.38 ▲0.0243.72 ▼2.80
Add New Post /wp-admin/post-new.php5.91 ▲0.0283.97 ▼5.98
Media Library /wp-admin/upload.php3.25 ▲0.0233.76 ▼0.64
Force Terms /wp-admin/options-general.php?page=fttnc-settings3.2731.38

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 7 new files
Database: no new tables, 7 new options
New WordPress options
fttnc_last_update
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for Force To Terms & Conditions
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲7913.21 ▼1.021.88 ▲0.1939.06 ▼2.04
Dashboard /wp-admin2,207 ▲155.75 ▲0.8695.48 ▼12.2738.33 ▼6.30
Posts /wp-admin/edit.php2,093 ▲42.02 ▲0.0133.23 ▼9.6833.72 ▼3.34
Add New Post /wp-admin/post-new.php1,517 ▼1617.69 ▼5.37657.61 ▼13.4651.32 ▼6.52
Media Library /wp-admin/upload.php1,392 ▲44.21 ▲0.0494.09 ▼13.7940.79 ▼6.78
Force Terms /wp-admin/options-general.php?page=fttnc-settings9182.0223.2628.23

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% 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
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • fttnc_last_update
    • db_upgraded
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/force-to-terms-conditions/force-to-tnc-user-profile.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/force-to-terms-conditions/script_frontend.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 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
3 plugin tags: redirect, terms and condition, force terms

force-to-terms-conditions/force-to-terms-conditions.php 85% from 13 tests

The primary PHP file in "Force To Terms & Conditions" version 2.0.0 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Description: Keep the plugin description shorter than 140 characters (currently 240 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected348 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP45157348

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity31.00
▷ Minimum class complexity31.00
▷ Maximum class complexity31.00
Average method complexity3.00
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods15
▷ Static methods213.33%
▷ Public methods15100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There are no PNG files in this plugin