72% add-rakuten

Code Review | Ad Rakuten

WordPress plugin Ad Rakuten scored 72% 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: 5.9.2
  • 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

50+ active / 1,104 total downloads


Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.09MB] [CPU: ▼290.23ms] Passed 4 tests

A check of server-side resources used by Ad Rakuten
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.69 ▲0.1856.22 ▼2.51
Dashboard /wp-admin3.52 ▲0.1234.35 ▲0.12
Posts /wp-admin/edit.php3.75 ▲0.1142.42 ▲6.16
Add New Post /wp-admin/post-new.php6.99 ▲0.0292.21 ▼1,162.59
Media Library /wp-admin/upload.php3.40 ▲0.1026.59 ▲4.05
Customize /wp-admin/customize.php?return=%2Fwp-admin%2Fwp-api.php4.6848.33

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 80 new files
Database: no new tables, 2 new options
New WordPress options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Ad Rakuten
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,948 ▲19416.37 ▲0.7010.24 ▲4.002.54 ▼0.46
Dashboard /wp-admin2,923 ▲696.01 ▼0.19116.48 ▼15.07183.48 ▲21.32
Posts /wp-admin/edit.php2,715 ▲243.12 ▼0.1169.27 ▲4.52147.11 ▲3.67
Add New Post /wp-admin/post-new.php1,833 ▲17216.27 ▼0.33399.87 ▼38.40165.96 ▲7.04
Media Library /wp-admin/upload.php1,712 ▲115.56 ▲0.02126.60 ▼14.52214.70 ▲24.68
Customize /wp-admin/customize.php?return=%2Fwp-admin%2Fwp-api.php7,75119.46510.38166.92

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • This plugin does not fully uninstall, leaving 2 options in the database
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These errors were triggered by the plugin
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/customize.php?return=%2Fwp-admin%2Fwp-api.php
    • > Notice in wp-includes/class-wp-customize-nav-menus.php+1152
    Trying to get property 'title' of non-object

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
The following issues need your attention
  • 4× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/add-rakuten/admin-footer-script.php
    • > /wp-content/plugins/add-rakuten/rakuten-admin-media-modal.php
    • > /wp-content/plugins/add-rakuten/ad-rakuten.php
    • > /wp-content/plugins/add-rakuten/rakuten_settings_page.php
  • 47× GET requests to PHP files have triggered server-side errors or warnings (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/GoraGoraGolfCourseSearch.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'RakutenRws_Api_AppRakutenApi' not found in wp-content/plugins/add-rakuten/sdk/lib/RakutenRws/Api/Definition/TravelGetHotelChainList.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'RakutenRws_Api_AppRakutenApi' not found in wp-content/plugins/add-rakuten/sdk/lib/RakutenRws/Api/Definition/BooksDVDSearch.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/TravelVacantHotelSearch.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'RakutenRws_Api_AppRakutenApi' not found in wp-content/plugins/add-rakuten/sdk/lib/RakutenRws/Api/Definition/FavoriteBookmarkAdd.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_HttpClient' not found in wp-content/plugins/add-rakuten/sdk/lib/RakutenRws/HttpClient/BasicHttpClient.php:19
    • > 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 Warning
      require_once(HTTP/Client.php): failed to open stream: No such file or directory in wp-content/plugins/add-rakuten/sdk/lib/RakutenRws/HttpClient/PearHttpClient.php on line 13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found


Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
3 plugin tags: shortcode, webservice, rakuten

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

"Ad Rakuten" version 0.0.11's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file 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 check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin3,271 lines of code in 69 files:
LanguageFilesBlank linesComment linesLines of code

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
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
▷ Abstract classes48.33%
▷ Concrete classes4491.67%
▷ Final classes00.00%
▷ Static methods21.31%
▷ Public methods14594.77%
▷ Protected methods85.23%
▷ Private methods00.00%
▷ Named functions19100.00%
▷ Anonymous functions00.00%
▷ Global constants360.00%
▷ Class constants240.00%
▷ Public constants2100.00%

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.01MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/rakuten-106x106.png6.05KB3.05KB▼ 49.52%
assets/img/rakuten-20x20.png1.82KB0.81KB▼ 55.81%