78% advanced-post-list

Code Review | Advanced Post List

WordPress plugin Advanced Post List scored 78% from 54 tests.

About plugin

  • Plugin page: advanced-post-list
  • Plugin version: 0.5.6.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-5.2
  • WordPress version: 5.8.1
  • First release: Oct 2, 2011
  • Latest release: Mar 22, 2020
  • Number of updates: 90
  • Update frequency: every 34.4 days
  • Top authors: EkoJr (56.67%)jokerbr313 (44.44%)

Code review

54 tests

User reviews

81 reviews

Install metrics

3,000+ active / 131,755 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.99MB] [CPU: ▼137.50ms] Passed 4 tests

A check of server-side resources used by Advanced Post List
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.73 ▲0.8928.50 ▲5.52
Dashboard /wp-admin4.08 ▲1.0238.28 ▲0.21
Posts /wp-admin/edit.php4.14 ▲1.0336.01 ▲5.17
Add New Post /wp-admin/post-new.php6.47 ▲1.0374.21 ▼560.91
Media Library /wp-admin/upload.php4.03 ▲1.0329.21 ▲5.66
All Post Lists /wp-admin/edit.php?post_type=apl_post_list4.1132.14
Settings /wp-admin/admin.php?page=apl_settings4.4928.59
- New Post List /wp-admin/post-new.php?post_type=apl_post_list5.0554.52

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 80 new files
Database: no new tables, 4 new options
New WordPress options
apl_notices
category_children
widget_advanced-post-list_default
apl_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Advanced Post List
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,739 ▲11215.57 ▼0.075.24 ▼0.1171.50 ▼2.96
Dashboard /wp-admin2,993 ▲976.20 ▲0.08118.12 ▼14.27168.93 ▼1.54
Posts /wp-admin/edit.php2,781 ▲383.25 ▲0.1864.11 ▲0.69136.39 ▼7.29
Add New Post /wp-admin/post-new.php3,749 ▼6618.90 ▼0.43425.76 ▼29.35159.76 ▼8.65
Media Library /wp-admin/upload.php1,813 ▲615.53 ▲0.03144.50 ▲8.13178.23 ▲0.54
All Post Lists /wp-admin/edit.php?post_type=apl_post_list1,5513.6199.97117.19
Settings /wp-admin/admin.php?page=apl_settings1,8813.7773.15156.10
- New Post List /wp-admin/post-new.php?post_type=apl_post_list6,4037.28241.07248.25

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 3 options in the database
    • apl_notices
    • category_children
    • widget_advanced-post-list_default

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
Please fix the following
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/advanced-post-list/templates/admin/meta-box/design/dialog-internal-shortcodes.php
    • > /wp-content/plugins/advanced-post-list/templates/admin/meta-box/settings-info.php
  • 15× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/advanced-post-list/advanced-post-list.php:44
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/advanced-post-list/includes/class/class-apl-widget.php:22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/advanced-post-list/includes/hooks.php:79
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/advanced-post-list/templates/admin/meta-box/settings-general.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/advanced-post-list/templates/admin/settings-page.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/advanced-post-list/templates/admin/meta-box/post-list-filter.php:23
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/advanced-post-list/admin/view/display/notice-default.php:13
    • > PHP Warning
      Use of undefined constant APL_VERSION - assumed 'APL_VERSION' (this will throw an Error in a future version of PHP) in wp-content/plugins/advanced-post-list/templates/admin/meta-box/settings-info.php on line 32
    • > PHP Warning
      require_once(APL_DIRadmin/functions-notice.php): failed to open stream: No such file or directory in wp-content/plugins/advanced-post-list/admin/class-apl-notices.php on line 122
    • > PHP Warning
      Use of undefined constant APL_DIR - assumed 'APL_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/advanced-post-list/admin/class-apl-notices.php on line 122

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need your attention:
  • Tags: Please reduce the number of tags, currently 71 tag instead of maximum 10
The official readme.txt might help

advanced-post-list/advanced-post-list.php 92% from 13 tests

The principal PHP file in "Advanced Post List" v. 0.5.6.1 is loaded by WordPress automatically on each request
Please take the time to fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 187 characters long)

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 detected10,639 lines of code in 50 files:
LanguageFilesBlank linesComment linesLines of code
PHP311,1794,8927,313
PO File24164851,412
CSS89786955
JavaScript8136390790
XML100169

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity55.71
▷ Minimum class complexity1.00
▷ Maximum class complexity227.00
Average method complexity4.81
▷ Minimum method complexity1.00
▷ Maximum method complexity58.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes14
▷ Abstract classes00.00%
▷ Concrete classes14100.00%
▷ Final classes00.00%
Methods201
▷ Static methods41.99%
▷ Public methods12964.18%
▷ Protected methods10.50%
▷ Private methods7135.32%
Functions36
▷ Named functions36100.00%
▷ Anonymous functions00.00%
Constants9
▷ Global constants9100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
13 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/css/jquery-ui/images/ui-bg_highlight-soft_75_cccccc_1x100.png0.27KB0.18KB▼ 35.00%
admin/css/jquery-ui/images/ui-bg_glass_75_dadada_1x400.png0.26KB0.16KB▼ 38.93%
admin/css/jquery-ui/images/ui-icons_222222_256x240.png6.76KB4.17KB▼ 38.24%
admin/css/jquery-ui/images/ui-icons_cd0a0a_256x240.png4.44KB4.17KB▼ 6.02%
admin/css/jquery-ui/images/ui-icons_454545_256x240.png6.83KB4.17KB▼ 38.86%