83% vejret-widget

Code Review | Vejret Widget

WordPress plugin Vejret Widget scored83%from 54 tests.

About plugin

  • Plugin page: vejret-widget
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.1-5.8
  • WordPress version: 6.3.1
  • First release: May 16, 2019
  • Latest release: Jul 16, 2021
  • Number of updates: 16
  • Update frequency: every 49.5 days
  • Top authors: vejret (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /876 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.02MB] [CPU: ▼5.30ms] Passed 4 tests

A check of server-side resources used by Vejret Widget
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0345.50 ▲1.62
Dashboard /wp-admin3.32 ▲0.0246.95 ▲1.50
Posts /wp-admin/edit.php3.37 ▲0.0242.47 ▼4.02
Add New Post /wp-admin/post-new.php5.92 ▲0.0482.87 ▼20.28
Media Library /wp-admin/upload.php3.24 ▲0.0233.18 ▲1.59

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 22 new files
Database: no new tables, 7 new options
New WordPress options
widget_vejret_widget
theysaidso_admin_options
widget_recent-posts
db_upgraded
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by Vejret Widget
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,887 ▲14113.56 ▼1.035.52 ▲3.7644.10 ▼0.20
Dashboard /wp-admin2,207 ▲285.80 ▼0.0597.16 ▼7.3037.29 ▼3.88
Posts /wp-admin/edit.php2,090 ▲42.02 ▲0.0335.68 ▼0.2829.42 ▼4.50
Add New Post /wp-admin/post-new.php1,518 ▼1222.88 ▼0.29600.37 ▼74.4448.99 ▼7.06
Media Library /wp-admin/upload.php1,392 ▲74.22 ▲0.0195.61 ▼5.2142.24 ▼1.17

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
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_vejret_widget
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded

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 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/vejret-widget/admin/partials/vejret-admin-display.php
    • > /wp-content/plugins/vejret-widget/public/partials/vejret-public-display.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that require attention:
  • Screenshots: Add a description for screenshot #1 in vejret-widget/assets to your readme.txt
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === vejret-widget === )
You can take inspiration from this readme.txt

vejret-widget/vejret.php 85% from 13 tests

This is the main PHP file of "Vejret Widget" version 1.0.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("vejret-widget.php" instead of "vejret.php")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected744 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP12147542398
JavaScript23852183
CSS2188163

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity4.62
▷ Minimum class complexity1.00
▷ Maximum class complexity27.00
Average method complexity2.07
▷ Minimum method complexity1.00
▷ Maximum method complexity24.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods27
▷ Static methods27.41%
▷ Public methods2281.48%
▷ Protected methods00.00%
▷ Private methods518.52%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There were not PNG files found in your plugin