78% pinblocks

Code Review | Pinblocks — Gutenberg blocks with Pinterest widgets

WordPress plugin Pinblocks — Gutenberg blocks with Pinterest widgets scored 78% from 54 tests.

About plugin

  • Plugin page: pinblocks
  • Plugin version: 1.0.2
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0.0-5.1
  • WordPress version: 5.9.2
  • First release: Feb 12, 2019
  • Latest release: Mar 3, 2019
  • Number of updates: 12
  • Update frequency: every 1.6 days
  • Top authors: milukove (100%)

Code review

54 tests

User reviews

1 review

Install metrics

50+ active / 1,197 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲3.71MB] [CPU: ▼291.54ms] 75% from 4 tests

A check of server-side resources used by Pinblocks — Gutenberg blocks with Pinterest widgets
The following require your attention
  • CPU: Total CPU usage must kept under 500.00ms (currently 1,411.94ms on /wp-admin/admin.php?page=pinblocks)
PageMemory (MB)CPU Time (ms)
Home /7.74 ▲4.2272.29 ▲11.64
Dashboard /wp-admin7.75 ▲4.3552.86 ▲18.36
Posts /wp-admin/edit.php7.76 ▲4.1255.48 ▲16.24
Add New Post /wp-admin/post-new.php9.14 ▲2.1774.56 ▼1,212.38
Media Library /wp-admin/upload.php7.75 ▲4.4643.52 ▲20.09
Freemius Debug [v.2.2.4] /wp-admin/admin.php?page=freemius7.7639.33
Pinblocks — Gutenberg blocks with Pinterest widgets /wp-admin/admin.php?page=pinblocks7.761,411.94

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 225 new files
Database: no new tables, 5 new options
New WordPress options
fs_accounts
fs_gdpr
fs_debug_mode
fs_active_plugins
fs_api_cache

Browser metrics Passed 4 tests

Checking browser requirements for Pinblocks — Gutenberg blocks with Pinterest widgets
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,801 ▲4717.09 ▲1.3416.97 ▲11.002.39 ▼0.69
Dashboard /wp-admin2,919 ▲596.16 ▲0.08115.48 ▼9.65165.43 ▼3.33
Posts /wp-admin/edit.php2,722 ▲313.24 ▼0.0064.01 ▼1.45155.32 ▲5.69
Add New Post /wp-admin/post-new.php1,689 ▲2822.60 ▲6.14442.58 ▲23.34174.29 ▲16.29
Media Library /wp-admin/upload.php1,726 ▲285.55 ▲0.01132.72 ▼4.06202.36 ▲14.75
Freemius Debug [v.2.2.4] /wp-admin/admin.php?page=freemius1,4432.5354.32129.79
Pinblocks — Gutenberg blocks with Pinterest widgets /wp-admin/admin.php?page=pinblocks1,2452.4552.34167.97

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
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 5 options
    • fs_gdpr
    • fs_debug_mode
    • fs_accounts
    • fs_api_cache
    • fs_active_plugins

Smoke tests 50% 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)
Good news, no errors were detected

SRP 0% 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
Almost there! Just fix the following items
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/pinblocks/freemius/templates/ajax-loader.php
  • 8× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/pinblocks/freemius/templates/account/partials/addon.php on line 8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function freemius() in wp-content/plugins/pinblocks/freemius/templates/partials/network-activation.php:6
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/pinblocks/freemius/templates/account/partials/addon.php on line 6
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_slug() on null in wp-content/plugins/pinblocks/freemius/templates/account/partials/addon.php:9
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/pinblocks/freemius/templates/account/partials/addon.php on line 8
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/pinblocks/freemius/templates/account/partials/addon.php on line 7
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/pinblocks/freemius/templates/account/partials/addon.php on line 6
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/pinblocks/freemius/templates/account/partials/addon.php on line 7

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)
No browser issues were found

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
5 plugin tags: gutenberg, pinterest, image, widget, block

pinblocks/pinblocks.php Passed 13 tests

The main PHP file in "Pinblocks — Gutenberg blocks with Pinterest widgets" ver. 1.0.2 adds more information about the plugin and also serves as the entry point for this plugin
120 characters long description:
Pinblocks — is a WordPress plugin created to add Pinterest Widgets to your posts and pages by Gutenberg editor blocks.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected42,190 lines of code in 177 files:
LanguageFilesBlank linesComment linesLines of code
PHP1096,29914,63326,447
PO File125,6106,73512,150
Sass29399772,529
JavaScript1180174815
Markdown1610192
JSON40043
CSS110014

PHP code 50% from 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
It is recommended to fix the following
  • Class cyclomatic complexity should be reduced to less than 1000 (currently 2,360)
Cyclomatic complexity
Average complexity per logical line of code0.60
Average class complexity75.29
▷ Minimum class complexity1.00
▷ Maximum class complexity2,360.00
Average method complexity4.30
▷ Minimum method complexity1.00
▷ Maximum method complexity83.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes45
▷ Abstract classes24.44%
▷ Concrete classes4395.56%
▷ Final classes00.00%
Methods1,046
▷ Static methods16615.87%
▷ Public methods73269.98%
▷ Protected methods151.43%
▷ Private methods29928.59%
Functions98
▷ Named functions9798.98%
▷ Anonymous functions11.02%
Constants116
▷ Global constants9682.76%
▷ Class constants2017.24%
▷ Public constants20100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
3 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
freemius/assets/img/pinblocks.png4.98KB2.39KB▼ 52.10%
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%