84% acf-location-rules-post-type-attachment

Code Review | ACF Location Rules Post Type Attachment

WordPress plugin ACF Location Rules Post Type Attachment scored84%from 54 tests.

About plugin

  • Plugin page: acf-location-rule...
  • Plugin version: 0.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.1
  • WordPress version: 6.3.1
  • First release: Nov 21, 2014
  • Latest release: Nov 22, 2014
  • Number of updates: 3
  • Update frequency: every 0.3 days
  • Top authors: Fastmover (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,156 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.00MB] [CPU: ▼8.45ms] Passed 4 tests

A check of server-side resources used by ACF Location Rules Post Type Attachment
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0138.38 ▼4.57
Dashboard /wp-admin3.32 ▼0.0350.85 ▼17.99
Posts /wp-admin/edit.php3.37 ▲0.0147.43 ▼3.01
Add New Post /wp-admin/post-new.php5.90 ▲0.0189.89 ▼8.24
Media Library /wp-admin/upload.php3.24 ▲0.0137.22 ▲5.66

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 3 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
can_compress_scripts
widget_recent-comments
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

ACF Location Rules Post Type Attachment: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.38 ▲0.021.83 ▲0.1540.47 ▼4.14
Dashboard /wp-admin2,195 ▲245.57 ▼0.0190.30 ▲3.0440.58 ▼0.72
Posts /wp-admin/edit.php2,100 ▲31.96 ▼0.0239.98 ▲2.9335.96 ▲0.34
Add New Post /wp-admin/post-new.php1,526 ▼023.43 ▼0.12609.88 ▼100.1856.70 ▲5.13
Media Library /wp-admin/upload.php1,397 ▼64.21 ▼0.0299.79 ▼8.4642.77 ▼7.73

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
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget

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
Please fix the following items
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/acf-location-rules-post-type-attachment/acf-location-rules-post-type-attachment.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
4 plugin tags: attachment, post_type attachment, acf, advanced custom fields

acf-location-rules-post-type-attachment/acf-location-rules-post-type-attachment.php Passed 13 tests

"ACF Location Rules Post Type Attachment" version 0.0.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
104 characters long description:
This plugin filters Advanced Custom Fields to add attachment back to post_type options in location rules

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
There were no executable files found in this plugin26 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP1121521
Markdown1205

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG files were detected