63% admin-page-framework

Code Review | Admin Page Framework

WordPress plugin Admin Page Framework scored63%from 54 tests.

About plugin

  • Plugin page: admin-page-framework
  • Plugin version: 3.9.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4-5.9.3
  • WordPress version: 6.3.1
  • First release: Feb 14, 2013
  • Latest release: Apr 15, 2022
  • Number of updates: 465
  • Update frequency: every 7.2 days
  • Top authors: miunosoft (100%)

Code review

54 tests

User reviews

23 reviews

Install metrics

100+ active /54,521 total downloads

Benchmarks

Plugin footprint 47% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲1.47MB] [CPU: ▲5.59ms] 75% from 4 tests

Server-side resources used by Admin Page Framework
The following require your attention
  • CPU: The total CPU usage must kept under 500.00ms (currently 565.47ms on /wp-admin/admin.php?page=apfl_addons)
PageMemory (MB)CPU Time (ms)
Home /4.28 ▲0.8247.03 ▲4.94
Dashboard /wp-admin5.00 ▲1.6956.05 ▲0.62
Posts /wp-admin/edit.php5.05 ▲1.6957.25 ▲16.48
Add New Post /wp-admin/post-new.php7.58 ▲1.69104.01 ▲1.75
Media Library /wp-admin/upload.php4.92 ▲1.6949.50 ▲15.03
Help /wp-admin/admin.php?page=apfl_contact7.9264.01
Tools /wp-admin/admin.php?page=apfl_tools8.88398.74
Add Ons /wp-admin/admin.php?page=apfl_addons8.49565.47

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 704 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
can_compress_scripts
widget_recent-comments
admin_page_framework_loader
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Admin Page Framework
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲5414.56 ▼0.081.73 ▲0.0448.27 ▲3.71
Dashboard /wp-admin2,206 ▲265.56 ▼0.0883.54 ▼3.9376.27 ▲39.89
Posts /wp-admin/edit.php2,132 ▲291.97 ▼0.1440.25 ▲1.1034.89 ▼3.34
Add New Post /wp-admin/post-new.php1,563 ▲2822.98 ▲4.71626.34 ▲5.97177.03 ▲112.39
Media Library /wp-admin/upload.php1,426 ▲264.16 ▼0.0696.26 ▲1.9559.61 ▲19.19
Help /wp-admin/admin.php?page=apfl_contact1,0962.1843.9440.79
Tools /wp-admin/admin.php?page=apfl_tools1,2862.4637.8336.97
Add Ons /wp-admin/admin.php?page=apfl_addons9612.4934.3730.64

Uninstaller [IO: ▲4.39MB] [DB: ▲0.01MB] 25% from 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • The plugin did not uninstall gracefully
    • > Compile error in wp-content/plugins/admin-page-framework/admin-page-framework-loader.php+228
    Cannot redeclare AdminPageFrameworkLoader_Warning() (previously declared in wp-content/plugins/admin-page-framework/admin-page-framework-loader.php:230)
  • The plugin did not uninstall correctly, leaving 704 files (4.39MB) in the plugin directory
    • (new file) asset/css/field_example.css
    • (new file) asset/css/feed-list.css
    • (new file) LICENSE.txt
    • (new file) asset/css/column.css
    • (new file) asset/css/admin.css
    • (new file) asset/css/about.css
    • (new file) asset/image/demo/wordpress-logo-2x.png
    • (new file) asset/css/help.css
    • (new file) asset/css/code.css
    • (new file) admin-page-framework-loader.php
    • ...
  • Zombie WordPress options detected upon uninstall: 8 options
    • widget_recent-posts
    • admin_page_framework_loader
    • theysaidso_admin_options
    • can_compress_scripts
    • recovery_mode_email_last_sent
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 360× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'AdminPageFramework_Link_Base' not found in wp-content/plugins/admin-page-framework/library/apf/factory/post_type/_controller/AdminPageFramework_Link_post_type.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'AdminPageFramework_PageLoadInfo_Base' not found in wp-content/plugins/admin-page-framework/library/apf/factory/admin_page/_view/AdminPageFramework_PageLoadInfo_admin_page.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'AdminPageFramework_WPUtility_URL' not found in wp-content/plugins/admin-page-framework/library/apf/factory/_common/utility/wp_utility/AdminPageFramework_WPUtility_HTML.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'AdminPageFramework_HelpPane_Base' not found in wp-content/plugins/admin-page-framework/library/apf/factory/post_type/_controller/AdminPageFramework_HelpPane_post_type.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'AdminPageFramework_Form_View___Generate_FlatFieldName' not found in wp-content/plugins/admin-page-framework/library/apf/factory/_common/form/_view/generator/field/AdminPageFramework_Form_View___Generate_FieldInputName.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'AdminPageFramework_Form_post_meta_box' not found in wp-content/plugins/admin-page-framework/library/apf/factory/page_meta_box/form/AdminPageFramework_Form_page_meta_box.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'AdminPageFrameworkLoader_AdminPage_RootBase' not found in wp-content/plugins/admin-page-framework/include/class/admin/_abstract/AdminPageFrameworkLoader_AdminPage_Section_Base.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'AdminPageFramework_Model__FormSubmission__Validator_Base' not found in wp-content/plugins/admin-page-framework/library/apf/factory/admin_page/_model/delegate/validaor/AdminPageFramework_Model__FormSubmission__Validator__Link.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'AdminPageFramework_WPUtility_SiteInformation' not found in wp-content/plugins/admin-page-framework/library/apf/factory/_common/utility/wp_utility/AdminPageFramework_WPUtility_SystemInformation.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'AdminPageFramework_Form_Controller' not found in wp-content/plugins/admin-page-framework/library/apf/factory/_common/form/AdminPageFramework_Form.php:9

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

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Tags: There are too many tags (14 tag instead of maximum 10)
  • Screenshots: Add images for these screenshots: #1 (**Text Fields**), #14 (**User Meta Fields**)
The official readme.txt might help

admin-page-framework/admin-page-framework-loader.php 92% from 13 tests

The primary PHP file in "Admin Page Framework" version 3.9.1 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("admin-page-framework.php" instead of "admin-page-framework-loader.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
Good job! No executable or dangerous file extensions detected68,575 lines of code in 640 files:
LanguageFilesBlank linesComment linesLines of code
PHP4783,0798,03930,877
JavaScript1114,0924,31520,800
JSON20011,487
CSS393473064,055
PO File3297327713
Markdown41050396
SVG130195
XML10738
HTML10614

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity6.12
▷ Minimum class complexity1.00
▷ Maximum class complexity159.00
Average method complexity2.12
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes477
▷ Abstract classes10020.96%
▷ Concrete classes37779.04%
▷ Final classes51.33%
Methods2,189
▷ Static methods28613.07%
▷ Public methods1,29959.34%
▷ Protected methods28913.20%
▷ Private methods60127.46%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants27
▷ Global constants13.70%
▷ Class constants2696.30%
▷ Public constants26100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
14 PNG files occupy 0.23MB with 0.10MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
asset/image/new_feature/table-field-type.png38.98KB15.92KB▼ 59.15%
example/library/path-custom-field-type/asset/jstree/themes/default/40px.png2.16KB1.84KB▼ 15.12%
example/library/path-custom-field-type/asset/img/file_sprite.png18.91KB6.96KB▼ 63.20%
asset/image/getting_started/my_first_plugin.png27.32KB11.07KB▼ 59.49%
asset/image/wp-logo_32x32.png2.04KB1.72KB▼ 15.81%