83% qr-code-generator-for-post

Code Review | QR Code Generator for Post

WordPress plugin QR Code Generator for Post scored83%from 54 tests.

About plugin

  • Plugin page: qr-code-generator...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.7
  • WordPress version: 6.3.1
  • First release: Sep 17, 2019
  • Latest release: May 18, 2021
  • Number of updates: 5
  • Update frequency: every 121.8 days
  • Top authors: largbasket (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /957 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼6.13ms] Passed 4 tests

Analyzing server-side resources used by QR Code Generator for Post
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.74 ▲0.0148.10 ▲2.15
Dashboard /wp-admin3.57 ▲0.0149.78 ▼0.71
Posts /wp-admin/edit.php3.69 ▲0.0147.84 ▼5.70
Add New Post /wp-admin/post-new.php6.15 ▲0.0194.10 ▼19.09
Media Library /wp-admin/upload.php3.50 ▲0.0138.80 ▲0.98

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 3 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

QR Code Generator for Post: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.37 ▼0.261.90 ▲0.1143.15 ▼1.21
Dashboard /wp-admin2,198 ▲275.66 ▲0.0490.26 ▼2.5541.48 ▼1.92
Posts /wp-admin/edit.php2,100 ▼02.04 ▲0.0540.45 ▲3.1934.60 ▲1.36
Add New Post /wp-admin/post-new.php1,526 ▼517.60 ▼5.60618.53 ▼69.1965.40 ▲16.90
Media Library /wp-admin/upload.php1,397 ▼34.21 ▼0.0999.95 ▼4.7645.79 ▼1.13

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/qr-code-generator-for-post/qr_code_generator_for_wordpress_post.php:46

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Screenshot-1), #2 (Screenshot-2), #3 (Screenshot-3)
Please take inspiration from this readme.txt

qr-code-generator-for-post/qr_code_generator_for_wordpress_post.php 77% from 13 tests

The main PHP file in "QR Code Generator for Post" ver. 1.0.0 adds more information about the plugin and also serves as the entry point for this plugin
Please make the necessary changes and fix the following:
  • Text Domain: The text domain name must use dashes instead of underscores, and it must be lowercase
  • Main file name: Name the main plugin file the same as the plugin slug ("qr-code-generator-for-post.php" instead of "qr_code_generator_for_wordpress_post.php")
  • Domain Path: The domain path is invalid: folder "/languages" does not exist

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Success! There were no dangerous files found in this plugin24 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP2134124

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.14
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
No PNG files were detected