78% rest-importer

Code Review | REST Importer

WordPress plugin REST Importer scored 78% from 54 tests.

About plugin

  • Plugin page: rest-importer
  • Plugin version: 0.1.5
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-4.7.3
  • WordPress version: 5.8.1
  • First release: Mar 13, 2017
  • Latest release: Dec 8, 2019
  • Number of updates: 8
  • Update frequency: every 124.4 days
  • Top authors: jhotadhari (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 663 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.77MB] [CPU: ▼136.09ms] Passed 4 tests

Server-side resources used by REST Importer
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.8141.75 ▲16.83
Dashboard /wp-admin3.82 ▲0.7654.05 ▲5.21
Posts /wp-admin/edit.php3.93 ▲0.8253.80 ▲10.28
Add New Post /wp-admin/post-new.php6.17 ▲0.74100.83 ▼567.97
Media Library /wp-admin/upload.php3.76 ▲0.7641.85 ▲8.12
REST Importer /wp-admin/tools.php?page=remp_options4.1941.55

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 594 new files
Database: no new tables, 1 new option
New WordPress options
recovery_mode_email_last_sent

Browser metrics Passed 4 tests

A check of browser resources used by REST Importer
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,710 ▲11415.84 ▲0.529.35 ▲1.2249.76 ▼1.87
Dashboard /wp-admin2,977 ▲435.85 ▼0.07146.74 ▲2.78114.92 ▼4.04
Posts /wp-admin/edit.php2,746 ▲72.69 ▲0.0069.46 ▼9.6195.79 ▼4.49
Add New Post /wp-admin/post-new.php1,620 ▼6321.39 ▲2.59273.93 ▼110.58114.10 ▲2.51
Media Library /wp-admin/upload.php1,814 ▲45.04 ▲0.01149.26 ▼7.78117.18 ▼9.94
REST Importer /wp-admin/tools.php?page=remp_options1,0662.1141.6870.89

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 1 option in the database
    • recovery_mode_email_last_sent

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These server-side errors were triggered
    • > GET request to /wp-admin/tools.php?page=remp_options
    • > Error in wp-content/plugins/rest-importer/includes/jhotadhari/cmb2_field_type_crypt/cmb2_field_type_crypt.php+117
    Uncaught Error: Call to undefined function mcrypt_get_iv_size() in wp-content/plugins/rest-importer/includes/jhotadhari/cmb2_field_type_crypt/cmb2_field_type_crypt.php:117
    Stack trace:
    #0 wp-content/plugins/rest-importer/includes/jhotadhari/cmb2_field_type_crypt/cmb2_field_type_crypt.php(39): cmb2_crypt_decrypt()
    #1 wp-includes/class-wp-hook.php(303): cmb2_crypt_render_callback()
    #2 wp-includes/class-wp-hook.php(327): WP_Hook->apply_filters()
    #3 wp-includes/plugin.php(470): WP_Hook->do_action()
    #4 wp-content/plugins/rest-importer/includes/webdevstudios/cmb2/includes/CMB2_Types.php(80): do_action()
    #5 wp-content/plugins/rest-importer/includes/webdevstudios/cmb2/includes/CMB2_Types.php(101): CMB2_Types->__call()
    #6 wp-content/plugins/rest-importer/includes/webdevstudios/cmb2/includes/CMB2_Types.php(91): CMB2_Types->_render()
    #7 wp-content/plug

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 take a closer look at the following
  • 127× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Textarea' not found in wp-content/plugins/rest-importer/includes/webdevstudios/cmb2/includes/types/CMB2_Type_Wysiwyg.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Taxonomy_Base' not found in wp-content/plugins/rest-importer/includes/webdevstudios/cmb2/includes/types/CMB2_Type_Taxonomy_Multicheck.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Text_Date' not found in wp-content/plugins/rest-importer/includes/webdevstudios/cmb2/includes/types/CMB2_Type_Text_Time.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Text' not found in wp-content/plugins/rest-importer/includes/webdevstudios/cmb2/includes/types/CMB2_Type_Colorpicker.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/rest-importer/includes/composer/installers/src/Composer/Installers/FuelInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/rest-importer/includes/composer/installers/src/Composer/Installers/HuradInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/rest-importer/includes/composer/installers/src/Composer/Installers/TYPO3FlowInstaller.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/rest-importer/includes/composer/installers/src/Composer/Installers/PhiftyInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/rest-importer/includes/composer/installers/src/Composer/Installers/ZikulaInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\Test\\TestCase' not found in wp-content/plugins/rest-importer/includes/composer/installers/tests/Composer/Installers/Test/GravInstallerTest.php:7

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
4 plugin tags: import, rest, json, remote

rest-importer/rest-importer.php 85% from 13 tests

The main PHP script in "REST Importer" version 0.1.5 is automatically included on every request by WordPress
It is important to fix the following:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Domain Path: The domain path points to an invalid folder, "/languages" does not exist

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected73,260 lines of code in 420 files:
LanguageFilesBlank linesComment linesLines of code
PO File12013,78217,88231,544
JavaScript351,0585,44916,748
PHP1663,1486,57611,390
CSS201,1591,1927,168
HTML2715732,325
Markdown1251801,677
Sass14265251,262
JSON1600754
LESS63924350
XML36238
Bourne Again Shell1454

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity9.11
▷ Minimum class complexity1.00
▷ Maximum class complexity151.00
Average method complexity3.02
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces5
Interfaces0
Traits0
Classes175
▷ Abstract classes126.86%
▷ Concrete classes16393.14%
▷ Final classes00.00%
Methods714
▷ Static methods9313.03%
▷ Public methods57179.97%
▷ Protected methods12517.51%
▷ Private methods182.52%
Functions81
▷ Named functions7390.12%
▷ Anonymous functions89.88%
Constants16
▷ Global constants425.00%
▷ Class constants1275.00%
▷ Public constants12100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
26 PNG files occupy 0.11MB with 0.05MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/vakata/jstree/src/themes/default/40px.png5.91KB1.84KB▼ 68.95%
includes/webdevstudios/cmb2/images/ui-bg_highlight-soft_75_cccccc_1x100.png0.10KB0.17KB0.00%
includes/vakata/jstree/test/visual/screenshots/desktop/desktop.png18.86KB6.92KB▼ 63.31%
includes/vakata/jstree/test/visual/screenshots/mobile/home.png6.22KB3.41KB▼ 45.16%
includes/vakata/jstree/test/visual/screenshots/desktop/home.png10.39KB4.40KB▼ 57.63%