84% block-views

Code Review | Block Views

WordPress plugin Block Views scored84%from 54 tests.

About plugin

  • Plugin page: block-views
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.2.3
  • WordPress version: 6.3.1
  • First release: Sep 19, 2019
  • Latest release: Sep 19, 2019
  • Number of updates: 3
  • Update frequency: every 1.0 days
  • Top authors: kbjohnson90 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /665 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▲2.40ms] Passed 4 tests

This is a short check of server-side resources used by Block Views
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0447.41 ▲0.90
Dashboard /wp-admin3.33 ▲0.0347.69 ▲2.12
Posts /wp-admin/edit.php3.38 ▲0.0248.21 ▲3.11
Add New Post /wp-admin/post-new.php5.92 ▲0.0393.27 ▲4.08
Media Library /wp-admin/upload.php3.26 ▲0.0237.33 ▲3.47

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Block Views
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,810 ▲3914.48 ▲0.132.00 ▼0.0642.09 ▼3.74
Dashboard /wp-admin2,206 ▲185.86 ▼0.05101.24 ▲2.6942.07 ▼3.27
Posts /wp-admin/edit.php2,089 ▼02.01 ▲0.0541.51 ▲6.2437.13 ▼0.85
Add New Post /wp-admin/post-new.php6,203 ▲4,66122.12 ▲4.12894.36 ▲276.1655.30 ▼0.33
Media Library /wp-admin/upload.php1,388 ▼34.20 ▼0.0094.06 ▼1.9341.80 ▼1.92

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please take a closer look at the following
  • 4× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/block-views/php_version_notice.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/block-views/shortcodes/init.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/block-views/block-views.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/block-views/tests/src/ExampleTest.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
7 plugin tags: post, data, posts, postmeta, view...

block-views/block-views.php Passed 13 tests

The entry point to "Block Views" version 1.0.0 is a PHP file that has certain tags in its header comment area
70 characters long description:
As a "Post View" and "Post Meta" block for creating custom post loops.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Everything looks great! No dangerous files found in this plugin7,626 lines of code in 27 files:
LanguageFilesBlank linesComment linesLines of code
JSON4007,177
JavaScript41814171
PHP82813144
YAML25163
Sass55339
Markdown315031
CSS1001

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity1.00
▷ Minimum class complexity1.00
▷ Maximum class complexity1.00
Average method complexity1.00
▷ Minimum method complexity1.00
▷ Maximum method complexity1.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes150.00%
Methods2
▷ Static methods150.00%
▷ Public methods2100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions6
▷ Named functions116.67%
▷ Anonymous functions583.33%
Constants0
▷ Global constants00.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
No PNG images were found in this plugin