78% add-rakuten

Code Review | Ad Rakuten

WordPress plugin Ad Rakuten scored78%from 54 tests.

About plugin

  • Plugin page: add-rakuten
  • Plugin version: 0.0.11
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.9.7
  • WordPress version: 6.3.1
  • First release: Jun 26, 2018
  • Latest release: Jul 6, 2018
  • Number of updates: 23
  • Update frequency: every 0.5 days
  • Top authors: Scion Lucifer (100%)

Code review

54 tests

User reviews

1 review

Install metrics

60+ active /1,425 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.11MB] [CPU: ▲0.42ms] Passed 4 tests

This is a short check of server-side resources used by Ad Rakuten
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.59 ▲0.1339.90 ▲0.92
Dashboard /wp-admin3.41 ▲0.1152.04 ▲5.11
Posts /wp-admin/edit.php3.53 ▲0.1750.14 ▲3.66
Add New Post /wp-admin/post-new.php6.00 ▲0.1191.99 ▼5.65
Media Library /wp-admin/upload.php3.34 ▲0.1035.82 ▲2.76

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 80 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for Ad Rakuten
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,934 ▲18813.66 ▼0.8810.38 ▲8.5944.15 ▲5.85
Dashboard /wp-admin2,228 ▲435.99 ▲0.1796.92 ▼5.2377.35 ▲30.88
Posts /wp-admin/edit.php2,110 ▲211.98 ▼0.0839.73 ▲3.4434.11 ▼2.99
Add New Post /wp-admin/post-new.php1,691 ▲17223.02 ▼0.17651.52 ▼19.4758.95 ▲10.68
Media Library /wp-admin/upload.php1,404 ▲194.22 ▼0.03107.74 ▲0.0674.30 ▲28.83

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

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
  • 4× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/add-rakuten/rakuten-admin-media-modal.php
    • > /wp-content/plugins/add-rakuten/rakuten_settings_page.php
    • > /wp-content/plugins/add-rakuten/admin-footer-script.php
    • > /wp-content/plugins/add-rakuten/ad-rakuten.php
  • 47× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'RakutenRws_Api_AppRakutenApi' not found in wp-content/plugins/add-rakuten/sdk/lib/RakutenRws/Api/Definition/TravelHotelDetailSearch.php:18
    • > PHP Fatal error
      Uncaught Error: Interface 'RakutenRws_Api_ApiInterface' not found in wp-content/plugins/add-rakuten/sdk/lib/RakutenRws/Api/Base.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'RakutenRws_Api_AppRakutenApi' not found in wp-content/plugins/add-rakuten/sdk/lib/RakutenRws/Api/Definition/BooksSoftwareSearch.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'RakutenRws_Api_Base' not found in wp-content/plugins/add-rakuten/sdk/lib/RakutenRws/Api/AppRakutenApi.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'RakutenRws_Api_AppRakutenApi' not found in wp-content/plugins/add-rakuten/sdk/lib/RakutenRws/Api/Definition/RecipeCategoryRanking.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'RakutenRws_Api_AppRakutenApi' not found in wp-content/plugins/add-rakuten/sdk/lib/RakutenRws/Api/Definition/BooksGenreSearch.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'RakutenRws_Api_AppRakutenApi' not found in wp-content/plugins/add-rakuten/sdk/lib/RakutenRws/Api/Definition/IchibaItemRanking.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'RakutenRws_Api_AppRakutenApi' not found in wp-content/plugins/add-rakuten/sdk/lib/RakutenRws/Api/Definition/TravelKeywordHotelSearch.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'RakutenRws_Api_AppRakutenApi' not found in wp-content/plugins/add-rakuten/sdk/lib/RakutenRws/Api/Definition/IchibaGenreSearch.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'RakutenRws_Api_AppRakutenApi' not found in wp-content/plugins/add-rakuten/sdk/lib/RakutenRws/Api/Definition/TravelHotelRanking.php:18

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 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
3 plugin tags: rakuten, webservice, shortcode

add-rakuten/ad-rakuten.php 92% from 13 tests

"Ad Rakuten" version 0.0.11's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("add-rakuten.php" instead of "ad-rakuten.php")

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
There were no executable files found in this plugin3,271 lines of code in 69 files:
LanguageFilesBlank linesComment linesLines of code
PHP586369112,345
Markdown31510431
JavaScript5108128332
CSS2163133
JSON10030

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity2.20
▷ Minimum class complexity1.00
▷ Maximum class complexity12.00
Average method complexity1.42
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces1
Traits0
Classes48
▷ Abstract classes48.33%
▷ Concrete classes4491.67%
▷ Final classes00.00%
Methods153
▷ Static methods21.31%
▷ Public methods14594.77%
▷ Protected methods85.23%
▷ Private methods00.00%
Functions19
▷ Named functions19100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants360.00%
▷ Class constants240.00%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
2 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/rakuten-20x20.png1.82KB0.81KB▼ 55.81%
assets/img/rakuten-106x106.png6.05KB3.05KB▼ 49.52%