84% spottr

Code Review | Spottr

WordPress plugin Spottr scored84%from 54 tests.

About plugin

  • Plugin page: spottr
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.5+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6.0-6.2
  • WordPress version: 6.3.1
  • First release: Apr 3, 2023
  • Latest release: Apr 3, 2023
  • Number of updates: 2
  • Update frequency: every 1.5 days
  • Top authors: spottr (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /101 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.44MB] [CPU: ▼5.71ms] Passed 4 tests

A check of server-side resources used by Spottr
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.89 ▲0.4348.41 ▲5.65
Dashboard /wp-admin3.80 ▲0.4549.35 ▼8.23
Posts /wp-admin/edit.php3.85 ▲0.4949.63 ▲2.97
Add New Post /wp-admin/post-new.php6.33 ▲0.4578.78 ▼22.52
Media Library /wp-admin/upload.php3.66 ▲0.4337.76 ▲4.93

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

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

Browser metrics Passed 4 tests

Spottr: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,846 ▲10015.40 ▲1.052.08 ▲0.4742.79 ▲2.20
Dashboard /wp-admin2,224 ▲447.31 ▲1.68109.29 ▲16.2342.62 ▼3.28
Posts /wp-admin/edit.php2,132 ▲354.31 ▲2.3347.25 ▲12.6534.96 ▼4.23
Add New Post /wp-admin/post-new.php6,320 ▲4,79425.30 ▲1.76974.14 ▲325.4440.30 ▼14.49
Media Library /wp-admin/upload.php1,426 ▲266.75 ▲2.49115.23 ▲12.6947.58 ▲4.79

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • 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
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following items
  • 665× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Cloudinary\\Transformation\\QualifierMultiValue' not found in wp-content/plugins/spottr/vendor/cloudinary/transformation-builder-sdk/src/Transformation/Effect/Misc/VectorizeValue.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Cloudinary\\Transformation\\Qualifier\\BaseExpressionQualifier' not found in wp-content/plugins/spottr/vendor/cloudinary/transformation-builder-sdk/src/Transformation/Positioning/X.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Cloudinary\\Asset\\BaseMediaAsset' not found in wp-content/plugins/spottr/vendor/cloudinary/cloudinary_php/src/Asset/Media.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/spottr/vendor/cloudinary/transformation-builder-sdk/tests/Unit/Transformation/Image/ResizeTest.php:33
    • > PHP Fatal error
      Trait 'Cloudinary\\Log\\LoggerTrait' not found in wp-content/plugins/spottr/vendor/cloudinary/cloudinary_php/src/Api/BaseApiClient.php on line 44
    • > PHP Fatal error
      Trait 'Cloudinary\\Transformation\\PixelEffectTrait' not found in wp-content/plugins/spottr/vendor/cloudinary/transformation-builder-sdk/src/Transformation/Effect/CommonEffectTrait.php on line 18
    • > PHP Fatal error
      Uncaught Error: Class 'Cloudinary\\Transformation\\EffectQualifier' not found in wp-content/plugins/spottr/vendor/cloudinary/transformation-builder-sdk/src/Transformation/Adjustment/RecolorQualifier.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'Cloudinary\\Transformation\\BlendEffectQualifier' not found in wp-content/plugins/spottr/vendor/cloudinary/transformation-builder-sdk/src/Transformation/Adjustment/Improve.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Cookie\\CookieJar' not found in wp-content/plugins/spottr/vendor/guzzlehttp/guzzle/src/Cookie/FileCookieJar.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Cloudinary\\Transformation\\LimitedEffectQualifier' not found in wp-content/plugins/spottr/vendor/cloudinary/transformation-builder-sdk/src/Transformation/Effect/StrengthEffectQualifier.php:20

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Screenshots: Please a description for screenshot #1 in spottr/assets to your readme.txt
Please take inspiration from this readme.txt

spottr/spottr.php Passed 13 tests

The principal PHP file in "Spottr" v. 1.0.0 is loaded by WordPress automatically on each request
64 characters long description:
Spottr helps connect your WordPress site to your Spottr account.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
No dangerous file extensions were detected67,963 lines of code in 1,132 files:
LanguageFilesBlank linesComment linesLines of code
PHP1,05213,55649,76458,875
Markdown321,76304,981
JSON17001,676
Twig611316770
CSS517139647
JavaScript51070452
Bourne Shell48244326
TypeScript224680
XML310474
YAML44064
make18013
SVG1005

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity4.19
▷ Minimum class complexity1.00
▷ Maximum class complexity88.00
Average method complexity1.60
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces89
Interfaces108
Traits192
Classes737
▷ Abstract classes8010.85%
▷ Concrete classes65789.15%
▷ Final classes13520.55%
Methods5,247
▷ Static methods1,96737.49%
▷ Public methods4,62088.05%
▷ Protected methods4037.68%
▷ Private methods2244.27%
Functions216
▷ Named functions5726.39%
▷ Anonymous functions15973.61%
Constants2,187
▷ Global constants90.41%
▷ Class constants2,17899.59%
▷ Public constants2,14098.26%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
2 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/woocommerce-placeholder-324x324.png27.46KB11.11KB▼ 59.55%
vendor/cloudinary/cloudinary_php/tests/assets/sample.png4.99KB3.40KB▼ 31.92%