83% hiweb-image-orient

Code Review | hiWeb Image Orient

WordPress plugin hiWeb Image Orient scored83%from 54 tests.

About plugin

  • Plugin page: hiweb-image-orient
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.5
  • WordPress version: 6.3.1
  • First release: Aug 14, 2016
  • Latest release: Feb 23, 2018
  • Number of updates: 6
  • Update frequency: every 93.2 days
  • Top authors: Den Media (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /834 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼4.55ms] Passed 4 tests

Analyzing server-side resources used by hiWeb Image Orient
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0332.30 ▼9.87
Dashboard /wp-admin3.34 ▲0.0344.45 ▼2.34
Posts /wp-admin/edit.php3.39 ▲0.0348.58 ▲0.17
Add New Post /wp-admin/post-new.php5.94 ▲0.0592.06 ▼5.95
Media Library /wp-admin/upload.php3.26 ▲0.0335.53 ▼0.05
hiWeb Images ReOrient /wp-admin/tools.php?page=hw-image-orient-tool3.2330.95

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for hiWeb Image Orient
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,808 ▲7313.25 ▼1.184.34 ▲2.2841.50 ▲0.41
Dashboard /wp-admin2,211 ▲235.82 ▼0.0696.71 ▼2.1838.03 ▼5.49
Posts /wp-admin/edit.php2,100 ▲112.01 ▼0.0147.65 ▲14.8538.61 ▲2.97
Add New Post /wp-admin/post-new.php1,534 ▼018.04 ▼5.12600.92 ▼68.5645.94 ▼6.72
Media Library /wp-admin/upload.php1,396 ▲84.21 ▼0.0293.03 ▼17.1639.96 ▼6.38
hiWeb Images ReOrient /wp-admin/tools.php?page=hw-image-orient-tool7782.0328.4731.42

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
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

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 fix the following
  • 12× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/hiweb-image-orient/inc/ajax.php:10
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_URL - assumed 'WP_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/hiweb-image-orient/inc/define.php on line 14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/hiweb-image-orient/inc/hooks.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_posts() in wp-content/plugins/hiweb-image-orient/template/_hw_io_tool_template.php:3
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_URL - assumed 'WP_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/hiweb-image-orient/inc/define.php on line 12
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_URL - assumed 'WP_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/hiweb-image-orient/inc/define.php on line 13
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_URL - assumed 'WP_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/hiweb-image-orient/inc/define.php on line 12
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_URL - assumed 'WP_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/hiweb-image-orient/inc/define.php on line 13
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_URL - assumed 'WP_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/hiweb-image-orient/inc/define.php on line 14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/hiweb-image-orient/inc/adminmenu.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 81% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (When you upload photos, the plugin reads EXIF meta data and turns the photos if needed. Uploading may be longer than usual.), #2 (If you already downloaded the pictures that have the wrong orientation, the plugin provides batch processing.), #3 (Batch processing has a minimum of controls), #4 (After you download or batch processing, all photos will automatically have the correct angle.)
  • Tags: Please delete some tags, you are using 20 tag instead of maximum 10
  • Donate link: Invalid URI ("")
The official readme.txt is a good inspiration

hiweb-image-orient/hiweb-image-orient.php Passed 13 tests

The principal PHP file in "hiWeb Image Orient" v. 1.1 is loaded by WordPress automatically on each request
71 characters long description:
This plugin read EXIF meta data, read orient info and auto-rotate image

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin238 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP82451172
JavaScript111455
CSS1217
Sass1204

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.52
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
4 PNG files occupy 0.61MB with 0.37MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png119.80KB43.16KB▼ 63.97%
screenshot-3.png42.04KB20.96KB▼ 50.14%
screenshot-2.png234.94KB79.84KB▼ 66.02%
screenshot-4.png224.99KB75.62KB▼ 66.39%