73% qr-code-for-pages

Code Review | QR Code for Pages

WordPress plugin QR Code for Pages scored73%from 54 tests.

About plugin

  • Plugin page: qr-code-for-pages
  • Plugin version: 2.0
  • PHP compatiblity: 7.4++
  • PHP version: 7.4.16
  • WordPress compatibility: 5.8-6.1.1
  • WordPress version: 6.3.1
  • First release: Feb 13, 2023
  • Latest release: Jun 28, 2023
  • Number of updates: 19
  • Update frequency: every 7.2 days
  • Top authors: ggroy (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /356 total downloads

Benchmarks

Plugin footprint 65% 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.64MB] [CPU: ▼16.69ms] Passed 4 tests

Server-side resources used by QR Code for Pages
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.61 ▲0.1538.17 ▼4.49
Dashboard /wp-admin3.44 ▲0.1456.53 ▲10.92
Posts /wp-admin/edit.php3.56 ▲0.2054.74 ▲4.07
Add New Post /wp-admin/post-new.php2.91 ▼2.9818.43 ▼74.01
Media Library /wp-admin/upload.php3.37 ▲0.1438.94 ▲7.69

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 210 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
db_upgraded
widget_recent-posts
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for QR Code for Pages
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,795 ▲914.25 ▲0.001.91 ▼0.5143.16 ▲0.60
Dashboard /wp-admin2,196 ▲165.56 ▼0.1089.43 ▲2.1039.05 ▲2.97
Posts /wp-admin/edit.php2,104 ▲41.98 ▼0.0135.44 ▼2.6435.40 ▼3.45
Add New Post /wp-admin/post-new.php1,532 ▲422.56 ▼0.42670.64 ▼28.0452.77 ▲0.48
Media Library /wp-admin/upload.php1,407 ▲44.19 ▼0.0297.04 ▼1.1440.82 ▼4.28

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin did not uninstall without warnings or errors
    • > Warning in wp-content/plugins/qr-code-for-pages/backend/src/Services/File/UploadDirectoryService.php+44
    rmdir(wp-content/uploads/me-qr-data/qr-codes): No such file or directory
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
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
Please fix the following items
  • 44× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Me_Qr\\Services\\Validation\\Assert\\Constraints\\ConstraintInterface' not found in wp-content/plugins/qr-code-for-pages/backend/src/Services/Validation/Assert/Constraints/AbstractConstraint.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Me_Qr\\Services\\Packages\\Response\\AbstractResponse' not found in wp-content/plugins/qr-code-for-pages/backend/src/Services/Packages/Response/SuccessResponse.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Me_Qr\\Services\\Packages\\Validator\\Assert\\Constraints\\AbstractConstraint' not found in wp-content/plugins/qr-code-for-pages/backend/src/Services/Packages/Validator/Assert/Constraints/NotNull.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Me_Qr\\Services\\Packages\\Validator\\Assert\\Constraints\\AbstractConstraint' not found in wp-content/plugins/qr-code-for-pages/backend/src/Services/Packages/Validator/Assert/Constraints/NotBlank.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Me_Qr\\Services\\Packages\\Response\\AbstractResponse' not found in wp-content/plugins/qr-code-for-pages/backend/src/Services/Packages/Response/SystemErrorResponse.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'Me_Qr\\Repository\\RepositoryInterface' not found in wp-content/plugins/qr-code-for-pages/backend/src/Repository/PluginSettingsRepository.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Me_Qr\\Services\\Validation\\Assert\\Constraints\\AbstractConstraint' not found in wp-content/plugins/qr-code-for-pages/backend/src/Services/Validation/Assert/Constraints/DateTime.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'Me_Qr\\Repository\\RepositoryInterface' not found in wp-content/plugins/qr-code-for-pages/backend/src/Repository/BackupInfoRepository.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'WP_REST_Controller' not found in wp-content/plugins/qr-code-for-pages/backend/src/Controller/AccountController.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'WP_REST_Controller' not found in wp-content/plugins/qr-code-for-pages/backend/src/Controller/UpdatePluginDataController.php:22

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)
No browser issues were found

Optimizations

Plugin configuration 83% 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
These attributes need to be fixed:
  • Tags: You are using too many tags: 11 tag instead of maximum 10
  • Requires php: The plugin version is formatted incorrectly
The official readme.txt is a good inspiration

qr-code-for-pages/me-qr.php 77% from 13 tests

The main file in "QR Code for Pages" v. 2.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("qr-code-for-pages.php" instead of "me-qr.php")
  • Requires PHP: Please use periods and digits for the required version (ex. "7.0" instead of "7.4+")
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, 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
Everything looks great! No dangerous files found in this plugin12,599 lines of code in 202 files:
LanguageFilesBlank linesComment linesLines of code
PHP1691,4529906,641
JavaScript161,0299593,737
CSS96421,155
JSON600809
PO File112671249
Markdown1508

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity4.39
▷ Minimum class complexity1.00
▷ Maximum class complexity47.00
Average method complexity1.97
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces53
Interfaces14
Traits0
Classes131
▷ Abstract classes53.82%
▷ Concrete classes12696.18%
▷ Final classes00.00%
Methods501
▷ Static methods9318.56%
▷ Public methods44989.62%
▷ Protected methods81.60%
▷ Private methods448.78%
Functions38
▷ Named functions12.63%
▷ Anonymous functions3797.37%
Constants121
▷ Global constants4234.71%
▷ Class constants7965.29%
▷ Public constants6379.75%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
There were not PNG files found in your plugin