10% custom-job-fields-for-wp-job-manager

Code Review | Custom Job Fields for WP Job Manager

WordPress plugin Custom Job Fields for WP Job Manager scored10%from 54 tests.

About plugin

  • Plugin page: custom-job-fields...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3-5.7
  • WordPress version: 6.3.1
  • First release: Nov 7, 2020
  • Latest release: Mar 7, 2021
  • Number of updates: 4
  • Update frequency: every 30.3 days
  • Top authors: devcrazy (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /1,463 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
You still need to fix the following installer errors
  • The plugin did not install without errors
    • > Notice in wp-content/plugins/custom-job-fields-for-wp-job-manager/includes/class-cfwjm-db.php+52
    Undefined variable: cfwjm_db_version

Server metrics [RAM: ▲0.32MB] [CPU: ▼8.09ms] Passed 4 tests

Server-side resources used by Custom Job Fields for WP Job Manager
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.83 ▲0.3735.58 ▼1.67
Dashboard /wp-admin3.66 ▲0.3247.27 ▼13.93
Posts /wp-admin/edit.php3.72 ▲0.3645.67 ▼3.35
Add New Post /wp-admin/post-new.php6.20 ▲0.3281.17 ▼13.40
Media Library /wp-admin/upload.php3.53 ▲0.3036.85 ▲4.88
Job Manager Custom Fields /wp-admin/edit.php?post_type=job_listing&page=cfjm_menu_add_field3.3623.38

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 34 new files
Database: 1 new table, 7 new options
New tables
wp_cfwjm_fields
New WordPress options
can_compress_scripts
theysaidso_admin_options
db_upgraded
widget_recent-posts
widget_recent-comments
cfwjm_db_version
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Custom Job Fields for WP Job Manager
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,881 ▲9513.32 ▼1.027.55 ▲5.5140.98 ▲0.56
Dashboard /wp-admin2,198 ▲215.61 ▼0.0083.10 ▼1.2640.44 ▼2.00
Posts /wp-admin/edit.php2,112 ▲92.05 ▲0.0435.76 ▲0.6430.06 ▼3.50
Add New Post /wp-admin/post-new.php1,535 ▲723.16 ▲0.18672.36 ▲27.6761.75 ▲9.85
Media Library /wp-admin/upload.php1,412 ▲124.23 ▲0.0094.69 ▼5.2542.88 ▼1.78
Job Manager Custom Fields /wp-admin/edit.php?post_type=job_listing&page=cfjm_menu_add_field280.420.213.75

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • The uninstall procedure failed, leaving 1 table in the database
    • wp_cfwjm_fields
  • Zombie WordPress options were found after uninstall: 7 options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • cfwjm_db_version
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/custom-job-fields-for-wp-job-manager/public/partials/cfwjm-public-display.php
  • 11× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Warning
      Use of undefined constant CFWJM_ADMIN_PATH - assumed 'CFWJM_ADMIN_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/custom-job-fields-for-wp-job-manager/lib/class-cfwjm-list-table.php on line 31
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/custom-job-fields-for-wp-job-manager/admin/partials/cfwjm-admin-edit-page.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/custom-job-fields-for-wp-job-manager/admin/partials/cfwjm-admin-add-form.php:16
    • > PHP Warning
      include_once(CFWJM_INCLUDE_PATHclass-cfwjm-db.php): failed to open stream: No such file or directory in wp-content/plugins/custom-job-fields-for-wp-job-manager/lib/class-cfwjm-list-table.php on line 30
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/custom-job-fields-for-wp-job-manager/admin/partials/cfwjm-admin-display.php:18
    • > PHP Warning
      Use of undefined constant CFWJM_INCLUDE_PATH - assumed 'CFWJM_INCLUDE_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/custom-job-fields-for-wp-job-manager/lib/class-cfwjm-list-table.php on line 30
    • > PHP Warning
      include_once(): Failed opening 'CFWJM_INCLUDE_PATHclass-cfwjm-db.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/custom-job-fields-for-wp-job-manager/lib/class-cfwjm-list-table.php on line 30
    • > PHP Warning
      include_once(): Failed opening 'CFWJM_ADMIN_PATHclass-cfwjm-admin.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/custom-job-fields-for-wp-job-manager/lib/class-cfwjm-list-table.php on line 31
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/custom-job-fields-for-wp-job-manager/admin/partials/cfwjm-admin-menu-add-field.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/custom-job-fields-for-wp-job-manager/admin/partials/cfwjm-admin-listtable.php:3

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/edit.php?post_type=job_listing&page=cfjm_menu_add_field
    • > Network (severe)
    wp-admin/edit.php?post_type=job_listing&page=cfjm_menu_add_field - Failed to load resource: the server responded with a status of 403 (Forbidden)

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that require attention: You can look at the official readme.txt

custom-job-fields-for-wp-job-manager/cfwjm.php 85% from 13 tests

The main file in "Custom Job Fields for WP Job Manager" v. 1.0.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("custom-job-fields-for-wp-job-manager.php" instead of "cfwjm.php")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

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
There were no executable files found in this plugin2,225 lines of code in 26 files:
LanguageFilesBlank linesComment linesLines of code
PHP193791,1751,625
JavaScript3106165487
CSS32878
Markdown125035

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity21.30
▷ Minimum class complexity1.00
▷ Maximum class complexity124.00
Average method complexity2.90
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods107
▷ Static methods1211.21%
▷ Public methods8074.77%
▷ Protected methods2220.56%
▷ Private methods54.67%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants480.00%
▷ Class constants120.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG files were detected