94% advanced-posts-blocks

Code Review | Advanced Posts Blocks

WordPress plugin Advanced Posts Blocks scored 94% from 54 tests.

About plugin

  • Plugin page: advanced-posts-bl...
  • Plugin version: 3.0.2
  • PHP compatiblity: 7.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.7-5.8
  • WordPress version: 5.8.1
  • First release: Jan 8, 2019
  • Latest release: Nov 8, 2021
  • Number of updates: 75
  • Update frequency: every 13.8 days
  • Top authors: Toro_Unit (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

200+ active / 10,895 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.10MB] [CPU: ▼152.02ms] Passed 4 tests

This is a short check of server-side resources used by Advanced Posts Blocks
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.94 ▲0.1124.92 ▲1.34
Dashboard /wp-admin3.17 ▲0.1031.61 ▼18.68
Posts /wp-admin/edit.php3.28 ▲0.1731.03 ▲1.68
Add New Post /wp-admin/post-new.php5.53 ▲0.0969.49 ▼590.45
Media Library /wp-admin/upload.php3.11 ▲0.1121.83 ▼0.28

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

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

Browser metrics Passed 4 tests

Advanced Posts Blocks: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,666 ▲6416.03 ▼0.025.24 ▼4.2877.40 ▲0.91
Dashboard /wp-admin2,933 ▲346.00 ▼0.17123.09 ▼8.59188.84 ▲11.44
Posts /wp-admin/edit.php2,737 ▼33.23 ▲0.0162.96 ▼3.82140.69 ▼9.63
Add New Post /wp-admin/post-new.php3,494 ▼31318.27 ▲2.13409.73 ▼51.38175.07 ▲5.47
Media Library /wp-admin/upload.php1,752 ▼05.54 ▲0.02142.57 ▼5.09186.01 ▲0.52

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The plugin uninstalled successfully, without leaving any zombie files or tables

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
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 fix the following
  • 7× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'Advanced_Posts_Blocks\\Blocks\\Renderer' not found in wp-content/plugins/advanced-posts-blocks/src/blocks/children/class-renderer.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_block_wrapper_attributes() in wp-content/plugins/advanced-posts-blocks/src/blocks/posts/template.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_block_wrapper_attributes() in wp-content/plugins/advanced-posts-blocks/src/blocks/post/template.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Advanced_Posts_Blocks\\add_action() in wp-content/plugins/advanced-posts-blocks/src/init.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Advanced_Posts_Blocks\\Blocks\\Renderer' not found in wp-content/plugins/advanced-posts-blocks/src/blocks/posts/class-renderer.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Advanced_Posts_Blocks\\Blocks\\Renderer' not found in wp-content/plugins/advanced-posts-blocks/src/blocks/post/class-renderer.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_block_wrapper_attributes() in wp-content/plugins/advanced-posts-blocks/src/blocks/children/template.php:16

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

readme.txt 94% 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
Attributes that require attention:
  • Screenshots: These screenshots require images: #1 (Blocks), #2 (Multiple Posts Block), #3 (Child Posts Block), #4 (Single Post Block)
Please take inspiration from this readme.txt

advanced-posts-blocks/advanced-posts-blocks.php Passed 13 tests

"Advanced Posts Blocks" version 3.0.2's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
26 characters long description:
Customizable posts blocks.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
No dangerous file extensions were detected1,399 lines of code in 31 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript147061772
PHP13103322413
JSON400214

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity7.60
▷ Minimum class complexity3.00
▷ Maximum class complexity12.00
Average method complexity2.48
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces5
Interfaces0
Traits0
Classes5
▷ Abstract classes120.00%
▷ Concrete classes480.00%
▷ Final classes00.00%
Methods23
▷ Static methods00.00%
▷ Public methods1669.57%
▷ Protected methods521.74%
▷ Private methods28.70%
Functions5
▷ Named functions240.00%
▷ Anonymous functions360.00%
Constants2
▷ Global constants00.00%
▷ Class constants2100.00%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
4 PNG files occupy 0.34MB with 0.24MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-4.png74.00KB20.99KB▼ 71.63%
screenshot-1.png89.01KB26.50KB▼ 70.23%
screenshot-3.png94.66KB27.00KB▼ 71.47%
screenshot-2.png94.07KB26.77KB▼ 71.54%