72% generator-razer-gold-pin-store

Code Review | Generator Razer Gold Pin Store

WordPress plugin Generator Razer Gold Pin Store scored72%from 54 tests.

About plugin

  • Plugin page: generator-razer-g...
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.4-5.8
  • WordPress version: 6.3.1
  • First release: Sep 9, 2021
  • Latest release: Sep 9, 2021
  • Number of updates: 2
  • Update frequency: every 1.0 days
  • Top authors: saulmorales (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,449 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

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

Analyzing server-side resources used by Generator Razer Gold Pin Store
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0242.87 ▲4.36
Dashboard /wp-admin3.33 ▼0.0249.53 ▼17.06
Posts /wp-admin/edit.php3.38 ▲0.0245.21 ▼11.08
Add New Post /wp-admin/post-new.php5.91 ▲0.0296.13 ▼5.48
Media Library /wp-admin/upload.php3.25 ▲0.0238.34 ▲2.90
Generar PIN /wp-admin/admin.php?page=create-razer-gold-pin-store-generate3.2033.03
Configuración /wp-admin/admin.php?page=config-razer-gold-pin-store-generate3.2238.27

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 585 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for Generator Razer Gold Pin Store
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲6914.35 ▲0.101.83 ▲0.0342.14 ▼3.48
Dashboard /wp-admin2,221 ▲445.53 ▼0.0986.65 ▼10.6782.18 ▲36.22
Posts /wp-admin/edit.php2,126 ▲261.96 ▼0.0536.71 ▲1.6632.65 ▼6.53
Add New Post /wp-admin/post-new.php1,563 ▲3723.12 ▼0.38732.24 ▲114.3055.87 ▲5.83
Media Library /wp-admin/upload.php1,426 ▲264.14 ▼0.08102.83 ▲0.2870.80 ▲19.61
Generar PIN /wp-admin/admin.php?page=create-razer-gold-pin-store-generate9972.3338.4838.33
Configuración /wp-admin/admin.php?page=config-razer-gold-pin-store-generate9892.2035.2336.56

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Please fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=create-razer-gold-pin-store-generate
    • > Warning in wp-includes/pluggable.php+1438
    Cannot modify header information - headers already sent by (output started at wp-includes/script-loader.php:2838)

SRP 0% 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
  • 5× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/generator-razer-gold-pin-store/lib/vendor/markbaker/matrix/examples/test.php
    • > /wp-content/plugins/generator-razer-gold-pin-store/lib/vendor/markbaker/complex/examples/testFunctions.php
    • > /wp-content/plugins/generator-razer-gold-pin-store/lib/vendor/markbaker/complex/examples/testOperations.php
    • > /wp-content/plugins/generator-razer-gold-pin-store/lib/vendor/markbaker/matrix/buildPhar.php
    • > /wp-content/plugins/generator-razer-gold-pin-store/lib/vendor/markbaker/complex/examples/complexTest.php
  • 162× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\SimpleCache\\CacheInterface' not found in wp-content/plugins/generator-razer-gold-pin-store/lib/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Collection/Memory.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/generator-razer-gold-pin-store/lib/vendor/saulmoralespa/razer-gold-pin-store/tests/RazerGoldPinStoreTest.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'PhpOffice\\PhpSpreadsheet\\Worksheet\\CellIterator' not found in wp-content/plugins/generator-razer-gold-pin-store/lib/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/ColumnCellIterator.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'PhpOffice\\PhpSpreadsheet\\Worksheet\\BaseDrawing' not found in wp-content/plugins/generator-razer-gold-pin-store/lib/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/MemoryDrawing.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Promise\\PromisorInterface' not found in wp-content/plugins/generator-razer-gold-pin-store/lib/vendor/guzzlehttp/guzzle/src/Pool.php:24
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Promise\\PromiseInterface' not found in wp-content/plugins/generator-razer-gold-pin-store/lib/vendor/guzzlehttp/promises/src/RejectedPromise.php:11
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Client\\ClientExceptionInterface' not found in wp-content/plugins/generator-razer-gold-pin-store/lib/vendor/psr/http-client/src/RequestExceptionInterface.php:14
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Promise\\PromiseInterface' not found in wp-content/plugins/generator-razer-gold-pin-store/lib/vendor/guzzlehttp/promises/src/Promise.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'PhpOffice\\PhpSpreadsheet\\Shared\\OLE\\PPS' not found in wp-content/plugins/generator-razer-gold-pin-store/lib/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/OLE/PPS/Root.php:31
    • > PHP Fatal error
      Uncaught Error: Class 'ZipStream\\Exception' not found in wp-content/plugins/generator-razer-gold-pin-store/lib/vendor/maennchen/zipstream-php/src/Exception/FileNotReadableException.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
5 plugin tags: pin, gold, store, serial, razer

generator-razer-gold-pin-store/generator-razer-gold-pin-store.php Passed 13 tests

The main file in "Generator Razer Gold Pin Store" v. 1.0.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
30 characters long description:
Generator Razer Gold Pin Store

Code Analysis 95% from 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
No dangerous file extensions were detected82,597 lines of code in 522 files:
LanguageFilesBlank linesComment linesLines of code
PHP45815,94437,58975,876
Markdown301,50004,497
JSON17001,707
JavaScript51412364
XML6182122
YAML30020
make1409
CSS2002

PHP code 0% from 2 tests

Analyzing cyclomatic complexity and code structure
It is recommended to fix the following
  • Class cyclomatic complexity should be reduced to less than 1000 (currently 1,022)
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 387)
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity32.09
▷ Minimum class complexity1.00
▷ Maximum class complexity1,022.00
Average method complexity3.89
▷ Minimum method complexity1.00
▷ Maximum method complexity387.00
Code structure
Namespaces65
Interfaces36
Traits3
Classes337
▷ Abstract classes195.64%
▷ Concrete classes31894.36%
▷ Final classes247.55%
Methods4,136
▷ Static methods93522.61%
▷ Public methods3,15276.21%
▷ Protected methods1062.56%
▷ Private methods87821.23%
Functions264
▷ Named functions15759.47%
▷ Anonymous functions10740.53%
Constants915
▷ Global constants40.44%
▷ Class constants91199.56%
▷ Public constants90699.45%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/img/razer-gold-logo.png1.79KB1.41KB▼ 21.34%