78% rokka-integration

Code Review | Rokka Integration

WordPress plugin Rokka Integration scored78%from 54 tests.

About plugin

  • Plugin page: rokka-integration
  • Plugin version: 5.1.0
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.1
  • WordPress version: 6.3.1
  • First release: Apr 24, 2017
  • Latest release: Feb 24, 2023
  • Number of updates: 75
  • Update frequency: every 28.5 days
  • Top authors: liip (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

20+ active /1,868 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.75MB] [CPU: ▼3.29ms] Passed 4 tests

A check of server-side resources used by Rokka Integration
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /4.22 ▲0.7549.56 ▲9.60
Dashboard /wp-admin4.07 ▲0.7250.54 ▼15.35
Posts /wp-admin/edit.php4.12 ▲0.7656.10 ▲5.35
Add New Post /wp-admin/post-new.php6.67 ▲0.7888.60 ▼8.74
Media Library /wp-admin/upload.php3.99 ▲0.7642.07 ▲5.58
Rokka Settings /wp-admin/options-general.php?page=rokka-integration_settings3.9737.11

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 513 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
rokka-integration_version
widget_theysaidso_widget
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

Rokka Integration: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,802 ▲4114.70 ▼0.021.57 ▼0.0442.34 ▼1.60
Dashboard /wp-admin2,208 ▲315.65 ▼0.0190.65 ▲2.8439.28 ▲0.95
Posts /wp-admin/edit.php2,113 ▲132.06 ▲0.0839.62 ▲2.6838.80 ▲3.87
Add New Post /wp-admin/post-new.php1,545 ▲1923.05 ▼0.16642.32 ▼45.2350.68 ▼6.96
Media Library /wp-admin/upload.php1,405 ▲54.19 ▲0.0395.50 ▼3.3440.47 ▼3.01
Rokka Settings /wp-admin/options-general.php?page=rokka-integration_settings9562.2826.2130.19

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • The uninstall procedure has failed, leaving 7 options in the database
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • rokka-integration_version
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP 0% 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
  • 3× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/rokka-integration/vendor/jbroadway/urlify/scripts/transliterate.php
    • > /wp-content/plugins/rokka-integration/vendor/jbroadway/urlify/scripts/filter.php
    • > /wp-content/plugins/rokka-integration/vendor/jbroadway/urlify/scripts/downcode.php
  • 68× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Rokka\\Client\\LocalImage\\AbstractLocalImage' not found in wp-content/plugins/rokka-integration/vendor/rokka/client/src/LocalImage/RokkaHash.php:22
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/rokka-integration/vendor/guzzlehttp/psr7/src/LazyOpenStream.php:13
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\MessageInterface' not found in wp-content/plugins/rokka-integration/vendor/psr/http-message/src/RequestInterface.php:24
    • > PHP Notice
      Undefined variable: argc in wp-content/plugins/rokka-integration/vendor/jbroadway/urlify/scripts/transliterate.php on line 10
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Promise\\PromiseInterface' not found in wp-content/plugins/rokka-integration/vendor/guzzlehttp/promises/src/RejectedPromise.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Rokka\\Client\\Core\\AbstractStack' not found in wp-content/plugins/rokka-integration/vendor/rokka/client/src/Core/StackAbstract.php:10
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/rokka-integration/vendor/guzzlehttp/psr7/src/BufferStream.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Rokka\\Client\\Core\\AbstractStack' not found in wp-content/plugins/rokka-integration/vendor/rokka/client/src/Core/StackUri.php:26
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/rokka-integration/vendor/guzzlehttp/psr7/src/DroppingStream.php:13
    • > PHP Parse error
      syntax error, unexpected '|', expecting '{' in wp-content/plugins/rokka-integration/vendor/symfony/polyfill-intl-normalizer/bootstrap80.php on line 18

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need to be fixed:
  • Screenshots: Please add images for these screenshots: #1 (Media management with rokka integration), #2 (Rokka settings), #3 (Rokka stack synchronization), #4 (Rokka mass uploader)
You can take inspiration from this readme.txt

rokka-integration/rokka-integration.php Passed 13 tests

The main file in "Rokka Integration" v. 5.1.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
52 characters long description:
Rokka image processing and cdn plugin for WordPress.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected54,242 lines of code in 486 files:
LanguageFilesBlank linesComment linesLines of code
PHP4264,00511,50647,092
Markdown251,63314,676
JSON16001,680
PO File2220306556
YAML9435214
Dockerfile18010
XML1008
CSS3173
JavaScript3033

PHP code 50% from 2 tests

A short review of cyclomatic complexity and code structure
The following items need your attention
  • Method cyclomatic complexity should be reduced to less than 100 (currently 179)
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity17.17
▷ Minimum class complexity1.00
▷ Maximum class complexity179.00
Average method complexity3.22
▷ Minimum method complexity1.00
▷ Maximum method complexity179.00
Code structure
Namespaces23
Interfaces16
Traits2
Classes143
▷ Abstract classes42.80%
▷ Concrete classes13997.20%
▷ Final classes2618.71%
Methods1,217
▷ Static methods28223.17%
▷ Public methods1,00382.42%
▷ Protected methods221.81%
▷ Private methods19215.78%
Functions178
▷ Named functions7240.45%
▷ Anonymous functions10659.55%
Constants301
▷ Global constants7825.91%
▷ Class constants22374.09%
▷ Public constants20692.38%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
5 PNG files occupy 0.59MB with 0.36MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png174.50KB47.33KB▼ 72.88%
assets/images/logo-liip.png1.99KB1.88KB▼ 5.63%
screenshot-4.png147.44KB36.80KB▼ 75.04%
screenshot-1.png116.07KB31.38KB▼ 72.97%
screenshot-3.png166.11KB38.24KB▼ 76.98%