78% pb-modular-pattern-system

Code Review | PB Modular Pattern System

WordPress plugin PB Modular Pattern System scored78%from 54 tests.

About plugin

  • Plugin page: pb-modular-patter...
  • Plugin version: 0.4.5
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-5.4.2
  • WordPress version: 6.3.1
  • First release: Aug 20, 2019
  • Latest release: Jul 30, 2020
  • Number of updates: 8
  • Update frequency: every 43.1 days
  • Top authors: patbloom (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /616 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.07MB] [CPU: ▼6.58ms] Passed 4 tests

Analyzing server-side resources used by PB Modular Pattern System
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0643.51 ▲3.62
Dashboard /wp-admin3.38 ▲0.0752.91 ▼3.37
Posts /wp-admin/edit.php3.49 ▲0.1348.59 ▼9.98
Add New Post /wp-admin/post-new.php5.96 ▲0.0791.55 ▼16.58
Media Library /wp-admin/upload.php3.30 ▲0.0740.77 ▲6.61
PB Modular Pattern System /wp-admin/options-general.php?page=pb-modular-pattern-system3.2735.69

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 364 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-comments
can_compress_scripts
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for PB Modular Pattern System
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,795 ▲3414.76 ▲0.341.75 ▼0.2843.35 ▼1.59
Dashboard /wp-admin2,204 ▲245.62 ▼0.0497.61 ▲8.7343.33 ▲6.47
Posts /wp-admin/edit.php2,106 ▲272.04 ▲0.0633.62 ▼6.5733.57 ▼3.49
Add New Post /wp-admin/post-new.php1,531 ▲323.10 ▼0.02622.84 ▼64.8749.84 ▼4.28
Media Library /wp-admin/upload.php1,409 ▲64.19 ▼0.0495.22 ▼7.8443.42 ▼3.08
PB Modular Pattern System /wp-admin/options-general.php?page=pb-modular-pattern-system9842.0227.9053.99

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% 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
  • 14× PHP files output text when accessed directly (only 10 are shown):
    • > /wp-content/plugins/pb-modular-pattern-system/_patterns/00-elements/image.php
    • > /wp-content/plugins/pb-modular-pattern-system/_patterns/00-elements/heading.php
    • > /wp-content/plugins/pb-modular-pattern-system/_patterns/00-elements/link.php
    • > /wp-content/plugins/pb-modular-pattern-system/functions/vendor_frameworks.php
    • > /wp-content/plugins/pb-modular-pattern-system/_patterns/00-elements/code.php
    • > /wp-content/plugins/pb-modular-pattern-system/_patterns/00-elements/link.blade.php
    • > /wp-content/plugins/pb-modular-pattern-system/_patterns/02-partials/uikit/3/usp/usp-bar-default.php
    • > /wp-content/plugins/pb-modular-pattern-system/_meta/foot.php
    • > /wp-content/plugins/pb-modular-pattern-system/_patterns/00-elements/text.blade.php
    • > /wp-content/plugins/pb-modular-pattern-system/_patterns/00-elements/heading.blade.php
  • 191× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Notice
      Undefined variable: var in wp-content/plugins/pb-modular-pattern-system/_patterns/02-partials/uikit/3/posts/postloop.php on line 11
    • > PHP Notice
      Undefined variable: var in wp-content/plugins/pb-modular-pattern-system/_patterns/02-partials/uikit/3/text/title-text-link-default.php on line 12
    • > PHP Notice
      Undefined variable: pbmps_element_tag in wp-content/plugins/pb-modular-pattern-system/_patterns/00-elements/heading.php on line 10
    • > PHP Notice
      Undefined variable: var in wp-content/plugins/pb-modular-pattern-system/_patterns/02-partials/uikit/3/posts/postloop.php on line 9
    • > PHP Notice
      Undefined variable: pbmps_element_text in wp-content/plugins/pb-modular-pattern-system/_patterns/00-elements/link.blade.php on line 11
    • > PHP Notice
      Undefined variable: pbmps_element_address_fax in wp-content/plugins/pb-modular-pattern-system/_patterns/00-elements/address.blade.php on line 39
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/pb-modular-pattern-system/_patterns/02-partials/uikit/3/posts/postloop.php on line 17
    • > PHP Notice
      Undefined variable: pbmps_element_classes in wp-content/plugins/pb-modular-pattern-system/_patterns/00-elements/text.blade.php on line 9
    • > PHP Notice
      Undefined variable: pbmps_element_classes in wp-content/plugins/pb-modular-pattern-system/_patterns/00-elements/link.blade.php on line 8
    • > PHP Notice
      Undefined variable: type in wp-content/plugins/pb-modular-pattern-system/_patterns/00-elements/heading.php on line 10

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Please fix the following attributes:
  • Tags: You are using too many tags: 16 tag instead of maximum 10
The official readme.txt might help

pb-modular-pattern-system/pb-modular-pattern-system.php 92% from 13 tests

The main PHP script in "PB Modular Pattern System" version 0.4.5 is automatically included on every request by WordPress
You should first fix the following items:
  • Domain Path: The domain path folder was not found ("/languages")

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
Good job! No executable or dangerous file extensions detected144,380 lines of code in 255 files:
LanguageFilesBlank linesComment linesLines of code
CSS1082,93019,65194,728
JavaScript10016,6224,48647,991
PHP312751421,102
SVG200289
LESS2417207
Blade210844
Markdown109019

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity17.00
▷ Minimum class complexity4.00
▷ Maximum class complexity30.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods32
▷ Static methods32100.00%
▷ Public methods32100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions18
▷ Named functions1794.44%
▷ Anonymous functions15.56%
Constants19
▷ Global constants19100.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
5 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/facebook.png0.76KB0.47KB▼ 37.85%
assets/images/mail.png1.16KB0.69KB▼ 40.34%
assets/images/linkedin.png1.19KB0.75KB▼ 36.86%
assets/images/pbmps-logo.png15.59KB9.63KB▼ 38.25%
assets/images/internet.png3.28KB1.84KB▼ 43.84%