78% advanced-post-block

Code Review | Advanced Post Block - Display Posts, Pages, or Custom Posts on Your Page

WordPress plugin Advanced Post Block - Display Posts, Pages, or Custom Posts on Your Page scored78%from 54 tests.

About plugin

  • Plugin page: advanced-post-block
  • Plugin version: 1.12.3
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Mar 11, 2021
  • Latest release: Nov 28, 2023
  • Number of updates: 115
  • Update frequency: every 8.6 days
  • Top authors: charlescormier (86.09%)abuhayat (14.78%)

Code review

54 tests

User reviews

13 reviews

Install metrics

10,000+ active /203,175 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.17MB] [CPU: ▼1.56ms] Passed 4 tests

Analyzing server-side resources used by Advanced Post Block - Display Posts, Pages, or Custom Posts on Your Page
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.62 ▲0.1537.20 ▼1.00
Dashboard /wp-admin3.48 ▲0.1349.82 ▼8.68
Posts /wp-admin/edit.php3.59 ▲0.2353.92 ▲8.40
Add New Post /wp-admin/post-new.php6.15 ▲0.2686.42 ▼2.23
Media Library /wp-admin/upload.php3.40 ▲0.1738.76 ▲5.67
Advanced Post Block /wp-admin/admin.php?page=advanced-post-block3.3637.33
Upgrade /wp-admin/edit.php?post_type=apb&page=apb-upgrade3.3734.64

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 70 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
apb_pro-redirect
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Advanced Post Block - Display Posts, Pages, or Custom Posts on Your Page
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /1,645 ▼1,10211.69 ▼2.661.09 ▼0.4329.20 ▼7.72
Dashboard /wp-admin2,300 ▲1195.52 ▼0.1989.40 ▼26.5261.50 ▲18.48
Posts /wp-admin/edit.php2,212 ▲1092.00 ▼0.0142.38 ▲2.2444.58 ▲9.53
Add New Post /wp-admin/post-new.php6,456 ▲4,93030.06 ▲7.21942.64 ▲256.2139.18 ▼32.43
Media Library /wp-admin/upload.php1,509 ▲1154.11 ▼0.1194.08 ▼4.5344.96 ▲1.87
Advanced Post Block /wp-admin/admin.php?page=advanced-post-block8992.4745.2528.61
Upgrade /wp-admin/edit.php?post_type=apb&page=apb-upgrade1,9093.3672.85141.62

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 does not fully uninstall, leaving 7 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • apb_pro-redirect
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% 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
Almost there! Just fix the following items
  • 6× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/advanced-post-block/inc/custom-post.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'BSDK' not found in wp-content/plugins/advanced-post-block/bplugins_sdk/inc/Base/Activate.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'APBPlugin' not found in wp-content/plugins/advanced-post-block/inc/block.php:2
    • > PHP Warning
      Use of undefined constant APB_VERSION - assumed 'APB_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 Fatal error
      Uncaught Error: Class 'BSDK' not found in wp-content/plugins/advanced-post-block/bplugins_sdk/inc/Base/License.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/advanced-post-block/inc/free.php:5

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Please fix the following browser errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=apb&page=apb-upgrade
    • > Javascript (severe) in unknown
    /wp-content/plugins/advanced-post-block/dist/admin.js?ver=1.12.3 0:1597 Uncaught TypeError: Cannot read properties of null (reading 'insertAdjacentElement')
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=apb&page=apb-upgrade
    • > Security (severe) in unknown
    https://js.freemius.com/vendors/nojquery.ba-postmessage.min.js?v=180 11 Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('http://localhost') does not match the recipient window's origin ('').

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:
  • Requires at least: The plugin version is formatted incorrectly
Please take inspiration from this readme.txt

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

The entry point to "Advanced Post Block - Display Posts, Pages, or Custom Posts on Your Page" version 1.12.3 is a PHP file that has certain tags in its header comment area
Please take the time to fix the following:
  • Main file name: The principal plugin file should be 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 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected2,640 lines of code in 51 files:
LanguageFilesBlank linesComment linesLines of code
PHP1516738855
JSON500568
JavaScript197131491
PO File2230468491
Sass3115184
CSS74651

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity8.50
▷ Minimum class complexity2.00
▷ Maximum class complexity19.00
Average method complexity2.19
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods63
▷ Static methods69.52%
▷ Public methods6196.83%
▷ Protected methods00.00%
▷ Private methods23.17%
Functions4
▷ Named functions250.00%
▷ Anonymous functions250.00%
Constants9
▷ Global constants9100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
bplugins_sdk/dist/assets/images/shield_success.png3.47KB3.61KB0.00%