78% acf-cpt-options-pages

Code Review | Advanced Custom Fields : CPT Options Pages

WordPress plugin Advanced Custom Fields : CPT Options Pages scored78%from 54 tests.

About plugin

  • Plugin page: acf-cpt-options-p...
  • Plugin version: 2.0.9
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.2
  • WordPress version: 6.3.1
  • First release: Jul 8, 2016
  • Latest release: Apr 8, 2023
  • Number of updates: 40
  • Update frequency: every 61.7 days
  • Top authors: Tusko Trush (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

3,000+ active /48,924 total downloads

Benchmarks

Plugin footprint 83% from 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.02MB] [CPU: ▼7.20ms] Passed 4 tests

A check of server-side resources used by Advanced Custom Fields : CPT Options Pages
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0245.69 ▲6.15
Dashboard /wp-admin3.33 ▲0.0349.78 ▲2.07
Posts /wp-admin/edit.php3.38 ▲0.0247.32 ▼7.59
Add New Post /wp-admin/post-new.php5.91 ▲0.0286.69 ▼22.83
Media Library /wp-admin/upload.php3.25 ▲0.0233.89 ▼0.44

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 14 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
db_upgraded
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

Advanced Custom Fields : CPT Options Pages: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,843 ▲8213.18 ▼1.182.56 ▲0.8242.91 ▲3.07
Dashboard /wp-admin2,224 ▲174.81 ▼0.13101.76 ▼25.9942.22 ▼5.68
Posts /wp-admin/edit.php2,103 ▲32.05 ▲0.0336.88 ▲0.7236.49 ▲2.70
Add New Post /wp-admin/post-new.php1,529 ▼1717.43 ▼5.89652.92 ▲39.0366.53 ▼2.31
Media Library /wp-admin/upload.php1,397 ▼34.21 ▲0.0297.78 ▼7.3441.74 ▼4.54

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
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 50% 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)
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/acf-cpt-options-pages/cpt-acf.php
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'ACFCPT_OptionsPages' not found in wp-content/plugins/acf-cpt-options-pages/tpl-settings-page.php:3

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 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need your attention:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === acf-cpt-options-pages === )
Please take inspiration from this readme.txt

acf-cpt-options-pages/cpt-acf.php 92% from 13 tests

The main PHP script in "Advanced Custom Fields : CPT Options Pages" version 2.0.9 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("acf-cpt-options-pages.php" instead of "cpt-acf.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin365 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP33828187
PO File33036114
JavaScript16046
JSON10018

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity11.00
▷ Minimum class complexity11.00
▷ Maximum class complexity11.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods11
▷ Static methods00.00%
▷ Public methods11100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions266.67%
▷ Anonymous functions133.33%
Constants3
▷ Global constants3100.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 images were found in this plugin