10% esponce-qr-code-generator

Code Review | Esponce QR Code Generator

WordPress plugin Esponce QR Code Generator scored 10% from 54 tests.

About plugin

  • Plugin page: esponce-qr-code-g...
  • Plugin version: 1.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-3.4.1
  • WordPress version: 6.3.1
  • First release: Jun 1, 2012
  • Latest release: Aug 28, 2012
  • Number of updates: 12
  • Update frequency: every 7.4 days
  • Top authors: esponce (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active / 4,035 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The following installer errors require your attention
  • The plugin did not install without errors
    • > Deprecated in wp-content/plugins/esponce-qr-code-generator/esp-widget.php+29
    Methods with the same name as their class will not be constructors in a future version of PHP; EsponceQRCodeWidget has a deprecated constructor

Server metrics [RAM: ▼1.77MB] [CPU: ▼54.57ms] Passed 4 tests

This is a short check of server-side resources used by Esponce QR Code Generator
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.22 ▼1.245.24 ▼40.30
Dashboard /wp-admin2.24 ▼1.067.24 ▼46.34
Posts /wp-admin/edit.php2.24 ▼1.127.10 ▼40.82
Add New Post /wp-admin/post-new.php2.24 ▼3.657.22 ▼90.83
Media Library /wp-admin/upload.php2.24 ▼0.996.45 ▼28.70

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 13 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
widget_esponceqrcodewidget
db_upgraded
theysaidso_admin_options
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for Esponce QR Code Generator
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.24 ▼1.051.65 ▼0.6243.21 ▼1.03
Dashboard /wp-admin2,203 ▲155.88 ▲1.0195.23 ▼16.6939.94 ▼10.21
Posts /wp-admin/edit.php2,089 ▲32.00 ▼0.0139.58 ▲3.5133.75 ▼2.86
Add New Post /wp-admin/post-new.php1,542 ▲818.38 ▼4.90608.02 ▼68.0852.12 ▲1.30
Media Library /wp-admin/upload.php1,388 ▼34.24 ▲0.04101.31 ▼0.5044.32 ▼0.24

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • Uninstall procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/esponce-qr-code-generator/esp-widget.php+29
    Methods with the same name as their class will not be constructors in a future version of PHP; EsponceQRCodeWidget has a deprecated constructor
  • This plugin does not fully uninstall, leaving 7 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_esponceqrcodewidget
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% 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
Please take a closer look at the following
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/esponce-qr-code-generator/tinymce/dialog.php
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/esponce-qr-code-generator/esp-widget.php:29
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/esponce-qr-code-generator/esp-widget.php:29

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)
Everything seems fine on the user side

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% 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
Attributes that require attention:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Creating a QR Code in blog post), #2 (Shortcode for HTML guys), #3 (Creating a widget), #4 (QR Code appears as sidebar widget)
  • Tags: Please delete some tags, you are using 11 tag instead of maximum 10
You can look at the official readme.txt

esponce-qr-code-generator/esp-qrcode.php 85% from 13 tests

The principal PHP file in "Esponce QR Code Generator" v. 1.4 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Description: The description should be shorter than 140 characters (currently 284 characters long)
  • Main file name: Name the main plugin file the same as the plugin slug ("esponce-qr-code-generator.php" instead of "esp-qrcode.php")

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
Everything looks great! No dangerous files found in this plugin1,385 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP61994221,092
JavaScript14079293

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity27.50
▷ Minimum class complexity13.00
▷ Maximum class complexity42.00
Average method complexity8.57
▷ Minimum method complexity1.00
▷ Maximum method complexity25.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods7
▷ Static methods00.00%
▷ Public methods7100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions19
▷ Named functions19100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
5 PNG files occupy 0.07MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-4.png5.35KB2.54KB▼ 52.60%
tinymce/icon.png1.00KB1.24KB0.00%
screenshot-1.png34.06KB16.60KB▼ 51.28%
screenshot-2.png15.02KB9.08KB▼ 39.53%
screenshot-3.png12.32KB6.16KB▼ 50.03%