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

Code Review | ACF Location Rules Post Type Attachment

WordPress plugin ACF Location Rules Post Type Attachment scored 94% 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: 5.8.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 / 924 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▼0.00MB] [CPU: ▼186.38ms] Passed 4 tests

An overview of server-side resources used by ACF Location Rules Post Type Attachment
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.84 ▲0.0022.81 ▼0.33
Dashboard /wp-admin3.06 ▼0.0030.85 ▼10.09
Posts /wp-admin/edit.php3.11 ▲0.0130.23 ▼0.74
Add New Post /wp-admin/post-new.php5.42 ▼0.0267.42 ▼732.99
Media Library /wp-admin/upload.php3.00 ▲0.0022.42 ▼1.71

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 3 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by ACF Location Rules Post Type Attachment
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,677 ▲7615.98 ▼0.055.07 ▼0.0176.64 ▼1.96
Dashboard /wp-admin2,930 ▲356.01 ▼0.08115.69 ▼30.79166.56 ▼13.38
Posts /wp-admin/edit.php2,737 ▼33.24 ▼0.0063.34 ▼1.72141.08 ▲3.29
Add New Post /wp-admin/post-new.php3,807 ▲7218.11 ▼0.58423.72 ▼36.77162.09 ▼0.84
Media Library /wp-admin/upload.php1,752 ▼05.50 ▲0.02143.17 ▲9.51184.03 ▼5.69

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
This plugin's uninstaller ran successfully

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)
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
Please take a closer look at the following
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > 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 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
4 plugin tags: post_type attachment, advanced custom fields, attachment, acf

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

The entry point to "ACF Location Rules Post Type Attachment" version 0.0.1 is a PHP file that has certain tags in its header comment area
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 check of programming languages and file extensions; no executable files are allowed
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
This plugin has no cyclomatic complexity problems
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

PNG files should be compressed to save space and minimize bandwidth usage
There were not PNG files found in your plugin