88% hosted-content-importer

Code Review | Hosted Content Importer (HCI)

WordPress plugin Hosted Content Importer (HCI) scored 88% from 53 tests.

About plugin

  • Plugin page: hosted-content-im...
  • Plugin version: 3.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.0-5.5.3
  • WordPress version: 5.8.1
  • First release: Apr 17, 2016
  • Latest release: Dec 5, 2020
  • Number of updates: 36
  • Update frequency: every 47.0 days
  • Top authors: pbimal (100%)

Code review

53 tests

User reviews

2 reviews

Install metrics

40+ active / 1,647 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.27MB] [CPU: ▼266.02ms] Passed 4 tests

Server-side resources used by Hosted Content Importer (HCI)
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.08 ▲0.3636.11 ▲15.05
Dashboard /wp-admin3.36 ▲0.3043.99 ▲1.71
Posts /wp-admin/edit.php3.41 ▲0.3043.24 ▼10.01
Add New Post /wp-admin/post-new.php5.66 ▲0.2390.79 ▼1,051.99
Media Library /wp-admin/upload.php3.24 ▲0.2333.43 ▼3.77
With [third] Tags /wp-admin/edit.php?page=hci/class.hosted_content_shortcode.inc.php3.2530.90

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 32 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Hosted Content Importer (HCI): an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,693 ▲8715.89 ▲0.358.51 ▼0.8950.78 ▲2.36
Dashboard /wp-admin2,945 ▲925.88 ▲0.01138.72 ▲9.68104.13 ▲7.09
Posts /wp-admin/edit.php2,711 ▲52.69 ▼0.0067.34 ▼0.4788.92 ▼2.50
Add New Post /wp-admin/post-new.php1,570 ▼8718.43 ▼0.40340.48 ▼41.14100.41 ▼12.11
Media Library /wp-admin/upload.php1,780 ▲85.02 ▲0.03149.87 ▲7.59115.97 ▼1.94
With [third] Tags /wp-admin/edit.php?page=hci/class.hosted_content_shortcode.inc.php1,5802.1981.3779.93

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Uninstaller ran successfully

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following items
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/hosted-content-importer/caches/index.php
    • > /wp-content/plugins/hosted-content-importer/pages/report-shortcodes.php
  • 18× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/hosted-content-importer/classes/hci/class.hosted_content_shortcode.inc.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'hosted_content_interface' not found in wp-content/plugins/hosted-content-importer/classes/processors/class.processor_wikipedia.inc.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'hci_ymdhis' not found in wp-content/plugins/hosted-content-importer/pages/list-caches.php:2
    • > PHP Warning
      Use of undefined constant HCI_PLUGIN_DIR - assumed 'HCI_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/hosted-content-importer/pages/list-processors.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'hosted_content_interface' not found in wp-content/plugins/hosted-content-importer/classes/processors/class.processor_code.inc.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'hosted_content_interface' not found in wp-content/plugins/hosted-content-importer/classes/processors/class.processor_analytics.inc.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'hosted_content_interface' not found in wp-content/plugins/hosted-content-importer/classes/processors/class.processor_none.inc.php:8
    • > PHP Notice
      Trying to get property 'posts' of non-object in wp-content/plugins/hosted-content-importer/pages/report-tags.php on line 10
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_results() on null in wp-content/plugins/hosted-content-importer/pages/report-tags.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'hosted_content_interface' not found in wp-content/plugins/hosted-content-importer/classes/processors/class.processor_qr.inc.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Tags: You are using too many tags: 12 tag instead of maximum 10
The official readme.txt might help

hosted-content-importer/hosted-content-importer.php Passed 13 tests

The main PHP script in "Hosted Content Importer (HCI)" version 3.0.3 is automatically included on every request by WordPress
99 characters long description:
Embeds third party contents within your blog. Usage: [third source="markdown" id="URL" section=""].

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
There were no executable files found in this plugin1,991 lines of code in 27 files:
LanguageFilesBlank linesComment linesLines of code
PHP235386911,910
CSS314866
JavaScript11015

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity16.24
▷ Minimum class complexity1.00
▷ Maximum class complexity230.00
Average method complexity3.59
▷ Minimum method complexity1.00
▷ Maximum method complexity24.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes17
▷ Abstract classes15.88%
▷ Concrete classes1694.12%
▷ Final classes318.75%
Methods101
▷ Static methods43.96%
▷ Public methods3938.61%
▷ Protected methods6160.40%
▷ Private methods10.99%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants266.67%
▷ Class constants133.33%
▷ Public constants1100.00%

Plugin size Passed 1 test

Image compression Passed 1 test

All PNG images should be compressed to minimize bandwidth usage for end users
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
tinymce/third.png2.93KB0.24KB▼ 91.96%