73% personal-qr-message

Code Review | Personal QR Message

WordPress plugin Personal QR Message scored73%from 54 tests.

About plugin

  • Plugin page: personal-qr-message
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5-5.9.2
  • WordPress version: 6.3.1
  • First release: May 16, 2022
  • Latest release: May 16, 2022
  • Number of updates: 3
  • Update frequency: every 1.7 days
  • Top authors: codres (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /176 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲1.50MB] [CPU: ▲10.91ms] Passed 4 tests

An overview of server-side resources used by Personal QR Message
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /4.97 ▲1.5053.07 ▲8.99
Dashboard /wp-admin4.80 ▲1.5066.38 ▲13.24
Posts /wp-admin/edit.php4.85 ▲1.4961.36 ▲11.71
Add New Post /wp-admin/post-new.php7.42 ▲1.53108.70 ▲14.57
Media Library /wp-admin/upload.php4.73 ▲1.4946.00 ▲9.68

Server storage [IO: ▲104.06MB] [DB: ▲0.00MB] 67% from 3 tests

Analyzing filesystem and database footprints of this plugin
These are issues you should consider
  • Filesystem usage must be lower than 25MB (currently using 104.06MB)
Filesystem: 972 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Personal QR Message
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,956 ▲17014.65 ▲0.2841.79 ▲39.7860.53 ▲15.64
Dashboard /wp-admin2,217 ▲435.68 ▲0.0391.51 ▼11.8741.22 ▼6.77
Posts /wp-admin/edit.php2,125 ▲252.19 ▲0.1940.23 ▲2.5536.64 ▼2.49
Add New Post /wp-admin/post-new.php1,545 ▲1923.50 ▲0.57703.96 ▲52.7251.29 ▼11.87
Media Library /wp-admin/upload.php1,416 ▲164.30 ▲0.0797.47 ▼10.6742.99 ▼0.10

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • The plugin did not uninstall gracefully
    • > Warning in wp-includes/class-wp-hook.php+310
    call_user_func_array() expects parameter 1 to be a valid callback, function 'remove_plugin' not found or invalid function name
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking 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 fix the following items
  • 466× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/personal-qr-message/vendor/alchemy/binary-driver/src/Alchemy/BinaryDriver/BinaryDriverTestCase.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'FontLib\\TrueType\\TableDirectoryEntry' not found in wp-content/plugins/personal-qr-message/vendor/phenx/php-font-lib/src/FontLib/OpenType/TableDirectoryEntry.php:16
    • > PHP Fatal error
      Uncaught Error: Interface 'Dotenv\\Repository\\Adapter\\ReaderInterface' not found in wp-content/plugins/personal-qr-message/vendor/vlucas/phpdotenv/src/Repository/Adapter/MultiReader.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\Cache\\Adapter\\AbstractTagAwareAdapter' not found in wp-content/plugins/personal-qr-message/vendor/symfony/cache/Adapter/FilesystemTagAwareAdapter.php:25
    • > PHP Fatal error
      require_once(): Failed opening required 'wp-content/plugins/personal-qr-message/vendor/chillerlan/php-qrcode/examples/../vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/personal-qr-message/vendor/chillerlan/php-qrcode/examples/text.php on line 15
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Client\\ClientExceptionInterface' not found in wp-content/plugins/personal-qr-message/vendor/psr/http-client/src/RequestExceptionInterface.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'FFMpeg\\Filters\\AdvancedMedia\\AbstractComplexFilter' not found in wp-content/plugins/personal-qr-message/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Filters/AdvancedMedia/CustomComplexFilter.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/personal-qr-message/vendor/neutron/temporary-filesystem/tests/Neutron/TemporaryFilesystem/Tests/ManagerTest.php:8
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\Cache\\Marshaller\\MarshallerInterface' not found in wp-content/plugins/personal-qr-message/vendor/symfony/cache/Marshaller/TagAwareMarshaller.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\Process\\Exception\\RuntimeException' not found in wp-content/plugins/personal-qr-message/vendor/symfony/process/Exception/ProcessTimedOutException.php:21

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that need to be fixed:
  • Screenshots: Screenshot #1 (Coming soon) image missing
Please take inspiration from this readme.txt

personal-qr-message/personal-qr-message.php Passed 13 tests

The main PHP script in "Personal QR Message" version 1.0 is automatically included on every request by WordPress
63 characters long description:
WordPress plugin to create a personal QR message for the buyer.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Everything looks great! No dangerous files found in this plugin87,054 lines of code in 842 files:
LanguageFilesBlank linesComment linesLines of code
PHP71317,46340,84174,019
Markdown542,17406,370
JSON39003,911
CSS6342522,013
YAML11709294
XML782240
HTML2260154
make212027
SVG40011
Dockerfile15210
Bourne Shell1203
JavaScript2012

PHP code 50% from 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Please fix the following
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 652)
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity17.67
▷ Minimum class complexity1.00
▷ Maximum class complexity807.00
Average method complexity3.52
▷ Minimum method complexity1.00
▷ Maximum method complexity652.00
Code structure
Namespaces123
Interfaces99
Traits19
Classes557
▷ Abstract classes356.28%
▷ Concrete classes52293.72%
▷ Final classes10119.35%
Methods4,668
▷ Static methods4549.73%
▷ Public methods3,91483.85%
▷ Protected methods4028.61%
▷ Private methods3527.54%
Functions432
▷ Named functions14533.56%
▷ Anonymous functions28766.44%
Constants430
▷ Global constants92.09%
▷ Class constants42197.91%
▷ Public constants37488.84%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
4 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor/chillerlan/php-qrcode/examples/example_image.png2.23KB1.09KB▼ 50.94%
vendor/dompdf/dompdf/lib/res/broken_image.png0.60KB0.47KB▼ 22.33%
vendor/chillerlan/php-qrcode/examples/example_svg.png15.55KB6.70KB▼ 56.90%
vendor/chillerlan/php-qrcode/examples/octocat.png2.41KB2.46KB0.00%