84% advanced-posts-blocks

Code Review | Advanced Posts Blocks

WordPress plugin Advanced Posts Blocks scored84%from 54 tests.

About plugin

  • Plugin page: advanced-posts-bl...
  • Plugin version: 5.2.0
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.1-6.3
  • WordPress version: 6.3.1
  • First release: Jan 8, 2019
  • Latest release: Jul 24, 2023
  • Number of updates: 84
  • Update frequency: every 19.8 days
  • Top authors: Toro_Unit (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

300+ active /15,809 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

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

A check of server-side resources used by Advanced Posts Blocks
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1142.25 ▲4.38
Dashboard /wp-admin3.40 ▲0.1047.62 ▼0.37
Posts /wp-admin/edit.php3.52 ▲0.1645.39 ▼3.77
Add New Post /wp-admin/post-new.php6.00 ▲0.1079.91 ▼6.02
Media Library /wp-admin/upload.php3.33 ▲0.0946.87 ▲14.44

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 44 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
can_compress_scripts
db_upgraded
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Advanced Posts Blocks
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲6813.24 ▼0.972.21 ▲0.3441.15 ▼2.64
Dashboard /wp-admin2,203 ▲295.82 ▲0.7998.55 ▼7.1339.36 ▼1.88
Posts /wp-admin/edit.php2,092 ▲31.96 ▼0.0838.81 ▼2.7334.32 ▼2.49
Add New Post /wp-admin/post-new.php1,556 ▲2125.01 ▲1.81607.35 ▲3.3429.10 ▼14.56
Media Library /wp-admin/upload.php1,391 ▲34.23 ▼0.06109.08 ▲6.1948.14 ▲6.00

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments

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)
Even though everything seems fine, this is not an exhaustive test

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
  • 7× PHP files trigger server errors when accessed directly:
    • > 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 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/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/post/template.php:16
    • > 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
    • > 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: Class 'Advanced_Posts_Blocks\\Blocks\\Renderer' not found in wp-content/plugins/advanced-posts-blocks/src/blocks/posts/class-renderer.php:18

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need your attention:
  • Screenshots: Add images for these screenshots: #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 5.2.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
26 characters long description:
Customizable posts blocks.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin1,430 lines of code in 37 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript187369741
PHP1296312377
JSON700312

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity9.00
▷ Minimum class complexity5.00
▷ Maximum class complexity15.00
Average method complexity2.72
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces5
Interfaces0
Traits0
Classes4
▷ Abstract classes125.00%
▷ Concrete classes375.00%
▷ Final classes00.00%
Methods20
▷ Static methods00.00%
▷ Public methods1365.00%
▷ Protected methods525.00%
▷ Private methods210.00%
Functions5
▷ Named functions240.00%
▷ Anonymous functions360.00%
Constants3
▷ Global constants00.00%
▷ Class constants3100.00%
▷ Public constants3100.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
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-1.png89.01KB26.50KB▼ 70.23%
screenshot-4.png74.00KB20.99KB▼ 71.63%
screenshot-3.png94.66KB27.00KB▼ 71.47%
screenshot-2.png94.07KB26.77KB▼ 71.54%