57% forcefield

Code Review | ForceField

WordPress plugin ForceField scored57%from 54 tests.

About plugin

  • Plugin page: forcefield
  • Plugin version: 1.2.9
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.0-6.2.2
  • WordPress version: 6.3.1
  • First release: Mar 1, 2021
  • Latest release: Jul 23, 2023
  • Number of updates: 28
  • Update frequency: every 52.5 days
  • Top authors: majick (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /670 total downloads

Benchmarks

Plugin footprint 46% 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: ▲6.69MB] [CPU: ▲35.87ms] 25% from 4 tests

An overview of server-side resources used by ForceField
Please fix the following
  • RAM: Try to keep total memory usage under 10MB (currently 10.69MB on /wp-admin/admin.php?page=freemius)
  • CPU: Total CPU usage must kept under 500.00ms (currently 928.56ms on /wp-admin/admin.php?page=forcefield)
  • Extra RAM: The extra memory usage should kept under 5MB (currently 6.69MB on /wp-admin/admin.php?page=freemius)
PageMemory (MB)CPU Time (ms)
Home /10.19 ▲6.7375.53 ▲31.14
Dashboard /wp-admin10.69 ▲7.38101.31 ▲45.35
Posts /wp-admin/edit.php10.69 ▲7.3388.75 ▲34.81
Add New Post /wp-admin/post-new.php11.20 ▲5.31126.39 ▲32.18
Media Library /wp-admin/upload.php10.69 ▲7.4688.83 ▲51.17
WordQuest /wp-admin/admin.php?page=wordquest10.691,416.18
ForceField /wp-admin/admin.php?page=forcefield10.69928.56
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius10.6974.92

Server storage [IO: ▲3.83MB] [DB: ▲0.21MB] Passed 3 tests

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 204 new files
Database: 1 new table, 14 new options
New tables
wp_forcefield_ips
New WordPress options
forcefield_first_install
wq_sidebar_options
wq
theysaidso_admin_options
forcefield
widget_recent-posts
fs_accounts
can_compress_scripts
widget_theysaidso_widget
db_upgraded
...

Browser metrics Passed 4 tests

A check of browser resources used by ForceField
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,073 ▲31213.47 ▼1.171.64 ▼0.2731.92 ▼18.96
Dashboard /wp-admin2,462 ▲2855.93 ▲0.4089.85 ▼6.2577.57 ▲35.25
Posts /wp-admin/edit.php2,195 ▲952.06 ▲0.0541.32 ▲2.0737.42 ▲0.03
Add New Post /wp-admin/post-new.php1,569 ▲4124.48 ▲1.40666.86 ▼13.0953.71 ▲1.70
Media Library /wp-admin/upload.php1,471 ▲714.26 ▲0.06103.22 ▼1.7674.11 ▲26.70
WordQuest /wp-admin/admin.php?page=wordquest1,7832.4532.3683.96
ForceField /wp-admin/admin.php?page=forcefield1,0331.8727.3450.61
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius1,1351.8227.6226.36

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • This plugin did not uninstall without warnings or errors
    • > Notice in wp-content/plugins/forcefield/freemius/includes/class-freemius.php+8486
    Undefined property: stdClass::$plugins
  • Zombie tables were found after uninstall: 1 table
    • wp_forcefield_ips
  • This plugin did not uninstall successfully, leaving 14 options in the database
    • can_compress_scripts
    • fs_accounts
    • db_upgraded
    • fs_debug_mode
    • forcefield_first_install
    • wq
    • theysaidso_admin_options
    • fs_active_plugins
    • widget_recent-posts
    • ff_sidebar_options
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

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 items
  • 5× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function has_action() in wp-content/plugins/forcefield/wordquest.php:92
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/forcefield/forcefield-block.php:119
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/forcefield/forcefield-auth.php:182
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/forcefield/loader.php:3171
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/forcefield/forcefield-apis.php:36

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There are user-side issues you should fix
    • > GET request to /wp-admin/admin.php?page=wordquest
    • > Network (severe)
    https://pluginreview.net/recommends/images/ - Failed to load resource: the server responded with a status of 403 (Forbidden)

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
7 plugin tags: security, rest api, admin protect, api access, xml rpc...

forcefield/loader.php 92% from 13 tests

The main PHP script in "ForceField" version 1.2.9 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("forcefield.php" instead of "loader.php")

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin44,645 lines of code in 146 files:
LanguageFilesBlank linesComment linesLines of code
PHP12610,41822,27743,968
Markdown21200387
JavaScript33459194
XML117777
CSS130013
JSON1006

PHP code 0% from 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
The following items need your attention
  • Please reduce cyclomatic complexity of classes to less than 1000 (currently 3,073)
  • Method cyclomatic complexity should be reduced to less than 100 (currently 129)
Cyclomatic complexity
Average complexity per logical line of code0.54
Average class complexity93.32
▷ Minimum class complexity1.00
▷ Maximum class complexity3,073.00
Average method complexity4.68
▷ Minimum method complexity1.00
▷ Maximum method complexity129.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes57
▷ Abstract classes23.51%
▷ Concrete classes5596.49%
▷ Final classes00.00%
Methods1,459
▷ Static methods20614.12%
▷ Public methods1,05572.31%
▷ Protected methods312.12%
▷ Private methods37325.57%
Functions264
▷ Named functions23689.39%
▷ Anonymous functions2810.61%
Constants162
▷ Global constants11470.37%
▷ Class constants4829.63%
▷ Public constants48100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
11 PNG files occupy 0.09MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
freemius/assets/img/forcefield.png9.16KB5.26KB▼ 42.58%
images/wordquest-icon.png1.24KB1.23KB0.40%
images/cross.png1.22KB1.11KB▼ 9.04%
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%