10% two-dimensional-code

Code Review | Two Dimensional Code

WordPress plugin Two Dimensional Code scored10%from 54 tests.

About plugin

  • Plugin page: two-dimensional-code
  • Plugin version: 1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.2.1-3.9.2
  • WordPress version: 6.3.1
  • First release: Aug 21, 2014
  • Latest release: Aug 28, 2014
  • Number of updates: 5
  • Update frequency: every 1.8 days
  • Top authors: chenxue4076 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /4,531 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
  • This plugin did not install gracefully
    • > Deprecated in wp-content/plugins/two-dimensional-code/widget.php+4
    Methods with the same name as their class will not be constructors in a future version of PHP; Qrcode_Widget has a deprecated constructor

Server metrics [RAM: ▼0.87MB] [CPU: ▼51.21ms] Passed 4 tests

This is a short check of server-side resources used by Two Dimensional Code
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.12 ▼0.358.01 ▼31.04
Dashboard /wp-admin3.14 ▼0.1710.10 ▼38.19
Posts /wp-admin/edit.php3.14 ▼0.229.72 ▼43.03
Add New Post /wp-admin/post-new.php3.14 ▼2.758.19 ▼92.57
Media Library /wp-admin/upload.php3.14 ▼0.0910.30 ▼25.53

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 12 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
db_upgraded
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments
widget_qrcode_activation
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Two Dimensional Code
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.25 ▼1.151.71 ▲0.0543.49 ▼2.95
Dashboard /wp-admin2,206 ▲185.90 ▲0.97106.69 ▼7.0340.93 ▼4.79
Posts /wp-admin/edit.php2,092 ▲142.15 ▲0.1039.56 ▼4.8834.81 ▼1.31
Add New Post /wp-admin/post-new.php1,542 ▲918.36 ▼4.76606.61 ▼43.4257.51 ▲0.35
Media Library /wp-admin/upload.php1,391 ▲34.21 ▲0.0594.90 ▼6.1440.13 ▼3.53

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
  • This plugin cannot be uninstalled
    • > Deprecated in wp-content/plugins/two-dimensional-code/widget.php+4
    Methods with the same name as their class will not be constructors in a future version of PHP; Qrcode_Widget has a deprecated constructor
  • The uninstall procedure has failed, leaving 7 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • widget_qrcode_activation
    • widget_recent-posts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

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
Almost there! Just fix the following items
  • 5× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/two-dimensional-code/index.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/two-dimensional-code/code.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/two-dimensional-code/widget.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Qrcode_Widget' not found in wp-content/plugins/two-dimensional-code/sider.php:2
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_DIR - assumed 'WP_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/two-dimensional-code/index.php on line 12

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 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need to be fixed:
  • Screenshots: Screenshot #1 (screenshot-1.jpg) image required
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === two-dimensional-code === )
The official readme.txt might help

two-dimensional-code/index.php 92% from 13 tests

This is the main PHP file of "Two Dimensional Code" version 1.3, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("two-dimensional-code.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin2,559 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP57035562,432
PO File2263288
Markdown121039

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity23.83
▷ Minimum class complexity1.00
▷ Maximum class complexity69.00
Average method complexity3.69
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes18
▷ Abstract classes15.56%
▷ Concrete classes1794.44%
▷ Final classes00.00%
Methods158
▷ Static methods6239.24%
▷ Public methods15698.73%
▷ Protected methods00.00%
▷ Private methods21.27%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants39
▷ Global constants39100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
png/_.png0.27KB0.25KB▼ 7.58%