83% oik-css

Code Review | oik-css

WordPress plugin oik-css scored83%from 54 tests.

About plugin

  • Plugin page: oik-css
  • Plugin version: 2.1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0+
  • WordPress version: 6.3.1
  • First release: Jul 9, 2013
  • Latest release: Oct 17, 2023
  • Number of updates: 46
  • Update frequency: every 81.6 days
  • Top authors: bobbingwide (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /3,697 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 gracefully, with no errors

Server metrics [RAM: ▲0.29MB] [CPU: ▼0.67ms] Passed 4 tests

This is a short check of server-side resources used by oik-css
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.80 ▲0.3341.38 ▼2.09
Dashboard /wp-admin3.63 ▲0.3248.20 ▲0.10
Posts /wp-admin/edit.php3.68 ▲0.3250.79 ▼0.70
Add New Post /wp-admin/post-new.php6.16 ▲0.2795.15 ▲0.01
Media Library /wp-admin/upload.php3.49 ▲0.2640.78 ▲5.52

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 63 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
db_upgraded
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for oik-css
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,792 ▲3114.34 ▼0.011.66 ▼0.0740.40 ▼3.34
Dashboard /wp-admin2,195 ▲155.48 ▼0.1584.07 ▼12.1536.60 ▼8.75
Posts /wp-admin/edit.php2,100 ▼31.97 ▼0.0638.92 ▼3.6436.24 ▼2.82
Add New Post /wp-admin/post-new.php6,366 ▲4,83827.62 ▲4.52789.06 ▲117.4154.00 ▼4.52
Media Library /wp-admin/upload.php1,400 ▼04.20 ▼0.1194.26 ▼3.0643.66 ▲1.78

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

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
  • 33× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Warning
      Use of undefined constant GESHI_CAPS_NO_CHANGE - assumed 'GESHI_CAPS_NO_CHANGE' (this will throw an Error in a future version of PHP) in wp-content/plugins/oik-css/geshi/geshi/php.php on line 65
    • > PHP Warning
      Use of undefined constant GESHI_CAPS_NO_CHANGE - assumed 'GESHI_CAPS_NO_CHANGE' (this will throw an Error in a future version of PHP) in wp-content/plugins/oik-css/geshi/geshi/jquery.php on line 46
    • > PHP Warning
      Use of undefined constant GESHI_CAPS_NO_CHANGE - assumed 'GESHI_CAPS_NO_CHANGE' (this will throw an Error in a future version of PHP) in wp-content/plugins/oik-css/geshi/geshi/mysql.php on line 58
    • > PHP Warning
      Use of undefined constant GESHI_COMMENTS - assumed 'GESHI_COMMENTS' (this will throw an Error in a future version of PHP) in wp-content/plugins/oik-css/geshi/geshi/php.php on line 989
    • > PHP Warning
      Use of undefined constant GESHI_CAPS_NO_CHANGE - assumed 'GESHI_CAPS_NO_CHANGE' (this will throw an Error in a future version of PHP) in wp-content/plugins/oik-css/geshi/geshi/css.php on line 63
    • > PHP Warning
      Use of undefined constant GESHI_NUMBER_OCT_PREFIX - assumed 'GESHI_NUMBER_OCT_PREFIX' (this will throw an Error in a future version of PHP) in wp-content/plugins/oik-css/geshi/geshi/php.php on line 1028
    • > PHP Warning
      Use of undefined constant GESHI_CAPS_NO_CHANGE - assumed 'GESHI_CAPS_NO_CHANGE' (this will throw an Error in a future version of PHP) in wp-content/plugins/oik-css/geshi/geshi/javascript.php on line 54
    • > PHP Warning
      Use of undefined constant GESHI_MAYBE - assumed 'GESHI_MAYBE' (this will throw an Error in a future version of PHP) in wp-content/plugins/oik-css/geshi/geshi/php.php on line 1067
    • > PHP Warning
      Use of undefined constant GESHI_NUMBER_INT_BASIC - assumed 'GESHI_NUMBER_INT_BASIC' (this will throw an Error in a future version of PHP) in wp-content/plugins/oik-css/geshi/geshi/php.php on line 86
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/oik-css/libs/oik-shortcodes.php:485

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 81% from 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
Attributes that require attention:
  • Tested up to: The plugin version is formatted incorrectly
  • Tags: There are too many tags (11 tag instead of maximum 10)
  • Screenshots: Add images for these screenshots: #1 (CSS block example), #2 (GeSHi block example), #3 ([bw_css] - syntax and examples), #4 ([bw_geshi] - examples), #5 (oik-CSS options - available when oik is active)
The official readme.txt is a good inspiration

oik-css/oik-css.php Passed 13 tests

The main PHP script in "oik-css" version 2.1.2 is automatically included on every request by WordPress
98 characters long description:
Implements CSS and GeSHi blocks for internal CSS styling and to help document source code examples

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin9,499 lines of code in 50 files:
LanguageFilesBlank linesComment linesLines of code
PHP258774,3747,848
JavaScript7451300885
PO File2172200416
JSON700279
Sass45043
Markdown120021
CSS4007

PHP code 50% from 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Please fix the following
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 189)
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity135.80
▷ Minimum class complexity3.00
▷ Maximum class complexity635.00
Average method complexity6.27
▷ Minimum method complexity1.00
▷ Maximum method complexity189.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods128
▷ Static methods2821.88%
▷ Public methods10884.38%
▷ Protected methods2015.62%
▷ Private methods00.00%
Functions202
▷ Named functions20199.50%
▷ Anonymous functions10.50%
Constants75
▷ Global constants75100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
3 PNG files occupy 0.05MB with 0.03MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-5.png15.73KB6.73KB▼ 57.18%
screenshot-4.png13.75KB7.48KB▼ 45.58%
screenshot-3.png24.88KB11.72KB▼ 52.89%