84% custom-fields-permalink-redux

Code Review | Custom Fields Permalink 2

WordPress plugin Custom Fields Permalink 2 scored84%from 54 tests.

About plugin

  • Plugin page: custom-fields-per...
  • Plugin version: 1.5.0
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5.0-5.0
  • WordPress version: 6.3.1
  • First release: Mar 2, 2018
  • Latest release: Oct 24, 2018
  • Number of updates: 30
  • Update frequency: every 39.8 days
  • Top authors: athlan (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

1,000+ active /5,030 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.06MB] [CPU: ▼8.10ms] Passed 4 tests

Server-side resources used by Custom Fields Permalink 2
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0736.95 ▼3.55
Dashboard /wp-admin3.37 ▲0.0643.66 ▼1.02
Posts /wp-admin/edit.php3.48 ▲0.1246.76 ▲4.22
Add New Post /wp-admin/post-new.php5.95 ▲0.0682.56 ▼32.03
Media Library /wp-admin/upload.php3.29 ▲0.0637.19 ▲8.65

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 14 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
_wordpress_custom_fields_permalink_plugin_version
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for Custom Fields Permalink 2
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲7913.23 ▼1.052.00 ▲0.1240.08 ▼2.67
Dashboard /wp-admin2,209 ▲215.82 ▲0.9199.70 ▼8.0335.65 ▼1.46
Posts /wp-admin/edit.php2,089 ▼32.04 ▼0.0240.59 ▲0.9939.04 ▲3.14
Add New Post /wp-admin/post-new.php1,533 ▼1323.14 ▲4.84650.42 ▼20.9256.31 ▲1.48
Media Library /wp-admin/upload.php1,382 ▼04.24 ▲0.0396.29 ▼2.3942.51 ▼0.43

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 7 options
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • _wordpress_custom_fields_permalink_plugin_version
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting 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: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/custom-fields-permalink-redux/includes/main.php:28
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/custom-fields-permalink-redux/includes/main.php:28

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
9 plugin tags: tax, permalinks, types, url, custom fields...

custom-fields-permalink-redux/wordpress-custom-fields-permalink-plugin.php 92% from 13 tests

"Custom Fields Permalink 2" version 1.5.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("custom-fields-permalink-redux.php" instead of "wordpress-custom-fields-permalink-plugin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected348 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP892313286
Markdown223043
JSON10019

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity6.83
▷ Minimum class complexity2.00
▷ Maximum class complexity16.00
Average method complexity2.79
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods20
▷ Static methods00.00%
▷ Public methods1575.00%
▷ Protected methods00.00%
▷ Private methods525.00%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants7
▷ Global constants114.29%
▷ Class constants685.71%
▷ Public constants6100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
2 PNG files occupy 0.07MB with 0.03MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-2.png39.41KB23.58KB▼ 40.18%
assets/screenshot-1.png30.68KB19.76KB▼ 35.58%