84% post-type-select-for-advanced-custom-fields

Code Review | Post Type Select Field for Advanced Custom Fields

WordPress plugin Post Type Select Field for Advanced Custom Fields scored 84% from 54 tests.

About plugin

  • Plugin page: post-type-select-...
  • Plugin version: 1.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.7.4
  • WordPress version: 6.3.1
  • First release: Nov 12, 2015
  • Latest release: Jul 2, 2017
  • Number of updates: 6
  • Update frequency: every 99.8 days
  • Top authors: gwelser (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

1,000+ active / 11,115 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

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

This is a short check of server-side resources used by Post Type Select Field for Advanced Custom Fields
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0146.25 ▲6.95
Dashboard /wp-admin3.31 ▲0.0051.39 ▼15.48
Posts /wp-admin/edit.php3.36 ▲0.0049.08 ▼6.13
Add New Post /wp-admin/post-new.php5.89 ▲0.00103.48 ▲13.73
Media Library /wp-admin/upload.php3.23 ▲0.0038.25 ▲3.49

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

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

Browser metrics Passed 4 tests

Post Type Select Field for Advanced Custom Fields: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲1113.24 ▼1.241.98 ▲0.2045.15 ▲6.35
Dashboard /wp-admin2,206 ▲124.86 ▲0.04104.52 ▼14.1037.12 ▼7.40
Posts /wp-admin/edit.php2,089 ▲32.05 ▲0.0337.80 ▲4.1134.10 ▼5.43
Add New Post /wp-admin/post-new.php1,524 ▼1823.32 ▲5.05718.87 ▲62.0358.90 ▼6.56
Media Library /wp-admin/upload.php1,382 ▼04.21 ▲0.0198.30 ▼4.9743.98 ▲0.25

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

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
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function load_plugin_textdomain() in wp-content/plugins/post-type-select-for-advanced-custom-fields/acf-posttype-select.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'acf_field' not found in wp-content/plugins/post-type-select-for-advanced-custom-fields/acf-posttype-select-v4.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'acf_field' not found in wp-content/plugins/post-type-select-for-advanced-custom-fields/acf-posttype-select-v5.php:2

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
4 plugin tags: advanced custom fields, post type, select, acf

post-type-select-for-advanced-custom-fields/acf-posttype-select.php 92% from 13 tests

The principal PHP file in "Post Type Select Field for Advanced Custom Fields" v. 1.1.0 is loaded by WordPress automatically on each request
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("post-type-select-for-advanced-custom-fields.php" instead of "acf-posttype-select.php")

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
No dangerous file extensions were detected265 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP352137265

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity10.50
▷ Minimum class complexity8.00
▷ Maximum class complexity13.00
Average method complexity3.38
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods8
▷ Static methods00.00%
▷ Public methods675.00%
▷ Protected methods00.00%
▷ Private methods225.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There are no PNG files in this plugin