78% gfirem-fields

Code Review | GFireM Fields

WordPress plugin GFireM Fields scored 78% from 54 tests.

About plugin

  • Plugin page: gfirem-fields
  • Plugin version: 1.1.7
  • PHP version: 7.4.16
  • WordPress version: 5.9.2
  • First release: Mar 20, 2017
  • Latest release: Jul 23, 2017
  • Number of updates: 22
  • Update frequency: every 5.2 days
  • Top authors: gfirem (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 583 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

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

An overview of server-side resources used by GFireM Fields
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0156.08 ▲3.11
Dashboard /wp-admin3.41 ▲0.0147.55 ▼12.63
Posts /wp-admin/edit.php3.64 ▲0.0139.20 ▼1.51
Add New Post /wp-admin/post-new.php6.88 ▼0.0994.08 ▼1,214.02
Media Library /wp-admin/upload.php3.30 ▲0.0025.53 ▼2.61

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 220 new files
Database: no new tables, 4 new options
New WordPress options
fs_debug_mode
fs_api_cache
fs_active_plugins
fs_accounts

Browser metrics Passed 4 tests

An overview of browser requirements for GFireM Fields
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,853 ▲13115.57 ▼0.116.63 ▲1.042.58 ▲0.37
Dashboard /wp-admin2,881 ▲236.01 ▼0.23119.74 ▼15.95162.52 ▼4.78
Posts /wp-admin/edit.php2,688 ▼63.24 ▲0.0064.61 ▼31.42143.68 ▼23.35
Add New Post /wp-admin/post-new.php1,711 ▲4021.46 ▲0.64468.15 ▲6.86179.25 ▲11.35
Media Library /wp-admin/upload.php1,695 ▼65.51 ▲0.02143.96 ▼9.94227.47 ▲38.70

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
The following items require your attention
  • This plugin did not uninstall successfully, leaving 4 options in the database
    • fs_api_cache
    • fs_active_plugins
    • fs_debug_mode
    • fs_accounts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% 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
The following issues need your attention
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/gfirem-fields/classes/fields/user_list/view/field_front_view.php
    • > /wp-content/plugins/gfirem-fields/classes/include/freemius/templates/ajax-loader.php
  • 25× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Notice
      Undefined variable: field in wp-content/plugins/gfirem-fields/classes/fields/user_list/view/field_front_view.php on line 12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/gfirem-fields/templates/_register_settings.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'gfirem_field_base' not found in wp-content/plugins/gfirem-fields/classes/fields/switch_button/switch_button.php:12
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/gfirem-fields/classes/fields/user_list/view/field_front_view.php on line 12
    • > PHP Fatal error
      Uncaught Error: Class 'gfirem_field_base' not found in wp-content/plugins/gfirem-fields/classes/fields/autocomplete/autocomplete.php:12
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/gfirem-fields/classes/fields/user_list/view/field_front_view.php on line 13
    • > PHP Warning
      include_once(GFIREM_VIEW_PATHhtml_admin_head.php): failed to open stream: No such file or directory in wp-content/plugins/gfirem-fields/view/html_admin.php on line 14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/gfirem-fields/view/html_admin.php:17
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/gfirem-fields/classes/fields/user_list/view/field_front_view.php on line 12
    • > PHP Notice
      Undefined variable: users in wp-content/plugins/gfirem-fields/classes/fields/user_list/view/field_front_view.php on line 13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that need to be fixed:
  • Requires at least: Version format is invalid
Please take inspiration from this readme.txt

gfirem-fields/gfirem.php 92% from 13 tests

The main PHP file in "GFireM Fields" ver. 1.1.7 adds more information about the plugin and also serves as the entry point for this plugin
Please make the necessary changes and fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("gfirem-fields.php" instead of "gfirem.php")

Code Analysis 97% from 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
There were no executable files found in this plugin26,656 lines of code in 176 files:
LanguageFilesBlank linesComment linesLines of code
PHP1144,11810,03118,336
PO File62,1652,1954,907
Sass18299761,875
JavaScript182512741,153
Markdown1610192
CSS173027143
JSON20050

PHP code 50% from 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Please fix the following
  • Cyclomatic complexity of classes has to be reduced to less than 1000 (currently 1,111)
Cyclomatic complexity
Average complexity per logical line of code0.50
Average class complexity28.12
▷ Minimum class complexity1.00
▷ Maximum class complexity1,111.00
Average method complexity3.16
▷ Minimum method complexity1.00
▷ Maximum method complexity76.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes68
▷ Abstract classes22.94%
▷ Concrete classes6697.06%
▷ Final classes00.00%
Methods898
▷ Static methods13915.48%
▷ Public methods66574.05%
▷ Protected methods525.79%
▷ Private methods18120.16%
Functions78
▷ Named functions7596.15%
▷ Anonymous functions33.85%
Constants106
▷ Global constants8983.96%
▷ Class constants1716.04%
▷ Public constants17100.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
5 PNG files occupy 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
classes/include/freemius/assets/img/formidable_action_after.png9.16KB5.26KB▼ 42.58%
classes/include/freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
classes/include/freemius/assets/img/formidable-copy-action.png9.16KB5.26KB▼ 42.58%
classes/include/freemius/assets/img/formidable-autocomplete.png9.16KB5.26KB▼ 42.58%
classes/include/freemius/assets/img/gfirem.png9.16KB5.26KB▼ 42.58%