74% acf-permalinks

Code Review | ACF Permalinks

WordPress plugin ACF Permalinks scored74%from 54 tests.

About plugin

  • Plugin page: acf-permalinks
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5.0-5.0
  • WordPress version: 6.3.1
  • First release: Aug 25, 2018
  • Latest release: Oct 24, 2018
  • Number of updates: 10
  • Update frequency: every 10.0 days
  • Top authors: athlan (100%)

Code review

54 tests

User reviews

1 review

Install metrics

600+ active /3,074 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼1.80MB] [CPU: ▼57.42ms] Passed 4 tests

Server-side resources used by ACF Permalinks
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.19 ▼1.275.81 ▼37.21
Dashboard /wp-admin2.21 ▼1.136.41 ▼49.60
Posts /wp-admin/edit.php2.21 ▼1.147.40 ▼37.84
Add New Post /wp-admin/post-new.php2.21 ▼3.676.31 ▼105.04
Media Library /wp-admin/upload.php2.21 ▼1.016.26 ▼27.65

Server storage [IO: ▲0.10MB] [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: 21 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for ACF Permalinks
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲7913.31 ▼1.114.42 ▲2.8340.67 ▲1.04
Dashboard /wp-admin2,228 ▲425.83 ▲0.91107.39 ▼0.1744.29 ▲0.65
Posts /wp-admin/edit.php2,110 ▲212.00 ▲0.0439.57 ▲3.4638.45 ▲5.45
Add New Post /wp-admin/post-new.php1,567 ▲3718.10 ▼0.33594.39 ▼5.3658.14 ▲8.73
Media Library /wp-admin/upload.php1,413 ▲224.29 ▲0.1295.06 ▼9.4943.06 ▼0.64

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin cannot be uninstalled
    • > Warning in wp-content/plugins/acf-permalinks/includes/preconditions/class-cfp-preconditions.php+33
    constant(): Couldn't find constant WORDPRESS_CUSTOM_FIELDS_PERMALINK_PLUGIN_VERSION
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The following issues need your attention
  • 10× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Interface 'AcfPermalinks\\Field_Permalink_Formatter' not found in wp-content/plugins/acf-permalinks/includes/formatter/class-post-formatter.php:17
    • > PHP Fatal error
      Uncaught Error: Interface 'AcfPermalinks\\Field_Permalink_Formatter' not found in wp-content/plugins/acf-permalinks/includes/formatter/class-default-formatter.php:16
    • > PHP Fatal error
      Uncaught Error: Interface 'AcfPermalinks\\Field_Permalink_Formatter' not found in wp-content/plugins/acf-permalinks/includes/formatter/class-datepicker-formatter.php:16
    • > PHP Notice
      Undefined variable: precondition_result in wp-content/plugins/acf-permalinks/includes/admin/plugin-dependency-notice.php on line 10
    • > PHP Fatal error
      Uncaught Error: Interface 'AcfPermalinks\\Field_Permalink_Formatter' not found in wp-content/plugins/acf-permalinks/includes/formatter/class-user-formatter.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/acf-permalinks/includes/main.php:49
    • > PHP Fatal error
      Uncaught Error: Interface 'AcfPermalinks\\Field_Permalink_Formatter' not found in wp-content/plugins/acf-permalinks/includes/formatter/class-checkbox-formatter.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/acf-permalinks/includes/main.php:49
    • > PHP Fatal error
      Uncaught Error: Interface 'AcfPermalinks\\Field_Permalink_Formatter' not found in wp-content/plugins/acf-permalinks/includes/formatter/class-radio-formatter.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function AcfPermalinks\\add_action() in wp-content/plugins/acf-permalinks/includes/admin/plugin-dependency-notice.php:34

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need to be fixed:
  • Tags: Please reduce the number of tags, currently 11 tag instead of maximum 10
The official readme.txt might help

acf-permalinks/acf-permalinks.php 92% from 13 tests

The main PHP file in "ACF Permalinks" ver. 1.0.0 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:
  • Description: The description should be shorter than 140 characters (currently 260 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected480 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
PHP16158475428
Markdown225052

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity3.23
▷ Minimum class complexity1.00
▷ Maximum class complexity9.00
Average method complexity1.73
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces2
Interfaces1
Traits0
Classes12
▷ Abstract classes00.00%
▷ Concrete classes12100.00%
▷ Final classes00.00%
Methods42
▷ Static methods511.90%
▷ Public methods3685.71%
▷ Protected methods00.00%
▷ Private methods614.29%
Functions2
▷ Named functions00.00%
▷ Anonymous functions2100.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
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%