94% advanced-post-block

Code Review | Advanced Post Block - Display Posts in Gutenberg Editor

WordPress plugin Advanced Post Block - Display Posts in Gutenberg Editor scored 94% from 54 tests.

About plugin

  • Plugin page: advanced-post-block
  • Plugin version: 1.6.7
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress version: 5.9.2
  • First release: Mar 11, 2021
  • Latest release: Mar 19, 2022
  • Number of updates: 56
  • Update frequency: every 6.7 days
  • Top authors: charlescormier (73.21%)abuhayat (28.57%)

Code review

54 tests

User reviews

5 reviews

Install metrics

2,000+ active / 15,170 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.05MB] [CPU: ▼315.94ms] Passed 4 tests

This is a short check of server-side resources used by Advanced Post Block - Display Posts in Gutenberg Editor
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.59 ▲0.0752.31 ▲2.08
Dashboard /wp-admin3.48 ▲0.0833.13 ▼0.90
Posts /wp-admin/edit.php3.71 ▲0.0737.54 ▲1.56
Add New Post /wp-admin/post-new.php6.96 ▼0.0095.98 ▼1,258.56
Media Library /wp-admin/upload.php3.36 ▲0.0623.35 ▼5.85

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 16 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by Advanced Post Block - Display Posts in Gutenberg Editor
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,791 ▲3716.55 ▲1.007.48 ▲1.612.28 ▼0.26
Dashboard /wp-admin2,892 ▲346.10 ▼0.16117.78 ▼12.15150.58 ▼7.73
Posts /wp-admin/edit.php2,688 ▼63.23 ▼0.0160.39 ▼4.03140.11 ▼3.39
Add New Post /wp-admin/post-new.php1,680 ▲1916.53 ▲0.48406.27 ▼56.88161.48 ▼1.97
Media Library /wp-admin/upload.php1,695 ▼05.52 ▼0.01137.01 ▼0.33185.64 ▼26.79

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Uninstall script ran successfully

Smoke tests 75% 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)
The smoke test was a success, however most plugin functionality was not tested

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
Almost there! Just fix the following items
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Warning
      Use of undefined constant AP_BLOCK_PLUGIN_VERSION - assumed 'AP_BLOCK_PLUGIN_VERSION' (this will throw an Error in a future version of PHP) in wp-content/plugins/advanced-post-block/dist/editor.asset.php on line 3
    • > PHP Warning
      Use of undefined constant AP_BLOCK_PLUGIN_VERSION - assumed 'AP_BLOCK_PLUGIN_VERSION' (this will throw an Error in a future version of PHP) in wp-content/plugins/advanced-post-block/dist/script.asset.php on line 3

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

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
Please fix the following attributes:
  • Requires at least: Version not formatted correctly
Please take inspiration from this readme.txt

advanced-post-block/plugin.php 92% from 13 tests

The main PHP file in "Advanced Post Block - Display Posts in Gutenberg Editor" ver. 1.6.7 adds more information about the plugin and also serves as the entry point for this plugin
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("advanced-post-block.php" instead of "plugin.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
Success! There were no dangerous files found in this plugin764 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP36219410
JSON100348
JavaScript41144
CSS2002

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity36.50
▷ Minimum class complexity5.00
▷ Maximum class complexity68.00
Average method complexity3.96
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods24
▷ Static methods28.33%
▷ Public methods24100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions4
▷ Named functions00.00%
▷ Anonymous functions4100.00%
Constants2
▷ Global constants2100.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
PNG images were not found in this plugin