78% navarak-code-highlighter

Code Review | Navarak Code Highlighter

WordPress plugin Navarak Code Highlighter scored78%from 54 tests.

About plugin

  • Plugin page: navarak-code-high...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.7.2
  • WordPress version: 6.3.1
  • First release: Jun 2, 2021
  • Latest release: Jun 2, 2021
  • Number of updates: 3
  • Update frequency: N/A
  • Top authors: sorroshsaket (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,958 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼3.82ms] Passed 4 tests

A check of server-side resources used by Navarak Code Highlighter
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0241.43 ▼3.02
Dashboard /wp-admin3.32 ▲0.0248.56 ▼6.77
Posts /wp-admin/edit.php3.37 ▲0.0252.84 ▲1.30
Add New Post /wp-admin/post-new.php5.92 ▲0.0486.73 ▼6.79
Media Library /wp-admin/upload.php3.25 ▲0.0238.72 ▲3.66

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 127 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by Navarak Code Highlighter
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,930 ▲14414.08 ▼0.2720.23 ▲18.0644.81 ▼1.75
Dashboard /wp-admin2,202 ▲225.61 ▼0.0592.97 ▼4.9943.28 ▼2.14
Posts /wp-admin/edit.php2,104 ▲42.01 ▲0.0334.50 ▼1.4335.86 ▲0.01
Add New Post /wp-admin/post-new.php1,533 ▲523.11 ▼0.08640.62 ▼22.9552.08 ▲0.07
Media Library /wp-admin/upload.php1,407 ▲74.16 ▲0.00103.43 ▼0.9149.10 ▲2.78

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/navarak-code-highlighter/admin/partials/navarak-code-highlighter-admin-display.php
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/navarak-code-highlighter/admin/partials/navarak-code-highlighter-admin-display.php on line 19
    • > PHP Notice
      Undefined variable: scanned_directory in wp-content/plugins/navarak-code-highlighter/admin/partials/navarak-code-highlighter-admin-display.php on line 19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/navarak-code-highlighter/public/partials/navarak-code-highlighter-public-display.php:19

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that require attention:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === navarak-code-highlighter === )
You can look at the official readme.txt

navarak-code-highlighter/navarak-code-highlighter.php Passed 13 tests

"Navarak Code Highlighter" version 1.0.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
101 characters long description:
This plugin is developed by NAVARAK team from 0 to learn users how to insert codes inside their posts

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
There were no executable files found in this plugin8,010 lines of code in 115 files:
LanguageFilesBlank linesComment linesLines of code
CSS991,3667476,389
JavaScript310351,349
PHP12128532234
PO File191138

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.12
Average class complexity1.86
▷ Minimum class complexity1.00
▷ Maximum class complexity4.00
Average method complexity1.24
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods26
▷ Static methods27.69%
▷ Public methods2180.77%
▷ Protected methods00.00%
▷ Private methods519.23%
Functions4
▷ Named functions375.00%
▷ Anonymous functions125.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
2 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/css/highlightjs/brown-papersq.png17.77KB9.92KB▼ 44.16%
public/css/highlightjs/school-book.png0.47KB0.34KB▼ 27.37%