88% acf-cpt-options-pages

Code Review | Advanced Custom Fields : CPT Options Pages

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

About plugin

  • Plugin page: acf-cpt-options-p...
  • Plugin version: 2.0.8
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-5.8.1
  • WordPress version: 5.9.2
  • First release: Jul 8, 2016
  • Latest release: Oct 14, 2021
  • Number of updates: 39
  • Update frequency: every 49.4 days
  • Top authors: Tusko Trush (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

3,000+ active / 35,423 total downloads


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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.02MB] [CPU: ▼292.25ms] Passed 4 tests

Server-side resources used by Advanced Custom Fields : CPT Options Pages
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0154.30 ▲6.17
Dashboard /wp-admin3.41 ▲0.0132.50 ▼0.54
Posts /wp-admin/edit.php3.65 ▲0.0136.87 ▼0.87
Add New Post /wp-admin/post-new.php6.89 ▼0.0894.75 ▼1,161.33
Media Library /wp-admin/upload.php3.30 ▼0.0023.32 ▼6.26

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 14 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Advanced Custom Fields : CPT Options Pages: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,801 ▲4715.83 ▲0.085.34 ▼1.182.33 ▼0.67
Dashboard /wp-admin2,901 ▲406.16 ▲0.06116.25 ▼15.69157.84 ▼3.33
Posts /wp-admin/edit.php2,697 ▲33.24 ▼0.0063.56 ▲3.33137.41 ▲1.64
Add New Post /wp-admin/post-new.php1,665 ▼4616.51 ▼4.20422.20 ▼16.91151.26 ▼5.97
Media Library /wp-admin/upload.php1,704 ▲65.49 ▲0.01137.04 ▼3.46179.72 ▼11.59

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Uninstall script ran successfully

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/acf-cpt-options-pages/cpt-acf.php
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > 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 just a short smoke test looking for browser issues
No browser errors were detected


Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need your attention:
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === acf-cpt-options-pages === )
You can take inspiration from this readme.txt

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

The principal PHP file in "Advanced Custom Fields : CPT Options Pages" v. 2.0.8 is loaded by WordPress automatically on each request
You should first fix the following items:
  • 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 | This is a short overview of programming languages used in this plugin, detecting executable files
Everything looks great! No dangerous files found in this plugin363 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PO File33036114

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity10.00
▷ Minimum class complexity10.00
▷ Maximum class complexity10.00
Average method complexity1.90
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
▷ Static methods00.00%
▷ Public methods11100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
▷ Named functions266.67%
▷ Anonymous functions133.33%
▷ 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
There are no PNG files in this plugin