83% rtsyntax

Code Review | rtSyntax

WordPress plugin rtSyntax scored83%from 54 tests.

About plugin

  • Plugin page: rtsyntax
  • Plugin version: 1.0.5
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.1
  • WordPress version: 6.3.1
  • First release: Dec 15, 2012
  • Latest release: Jun 4, 2015
  • Number of updates: 16
  • Update frequency: every 67.3 days
  • Top authors: JoshuaAbenazer (50%)rtcamp (43.75%)rahul286 (18.75%)

Code review

54 tests

User reviews

4 reviews

Install metrics

10+ active /2,015 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▼4.54ms] Passed 4 tests

Server-side resources used by rtSyntax
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0538.53 ▼3.63
Dashboard /wp-admin3.36 ▲0.0544.77 ▼2.23
Posts /wp-admin/edit.php3.41 ▲0.0548.72 ▼3.51
Add New Post /wp-admin/post-new.php5.94 ▲0.0590.53 ▼7.54
Media Library /wp-admin/upload.php3.28 ▲0.0534.93 ▼3.48
rtSyntax /wp-admin/options-general.php?page=rtsyntax3.2431.54

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

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

Browser metrics Passed 4 tests

rtSyntax: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,835 ▲10013.78 ▼0.606.86 ▲5.0844.89 ▲0.64
Dashboard /wp-admin2,213 ▲345.85 ▼0.01101.00 ▼2.2942.49 ▲1.62
Posts /wp-admin/edit.php2,093 ▲42.00 ▲0.0340.80 ▼1.0534.48 ▼8.33
Add New Post /wp-admin/post-new.php1,517 ▼217.44 ▼5.64666.39 ▲20.3062.72 ▲6.55
Media Library /wp-admin/upload.php1,389 ▲44.24 ▼0.0095.76 ▼6.7839.48 ▼1.81
rtSyntax /wp-admin/options-general.php?page=rtsyntax9002.0625.1027.68

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
  • The uninstall procedure has failed, leaving 7 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • rtsyntax_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/rtsyntax/rtsyntax.php:16

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Please fix the following attributes:
  • Tags: Please delete some tags, you are using 17 tag instead of maximum 10
  • Screenshots: Add images for these screenshots: #1 (Simple, single setting), #2 (Visual Editor buttons), #3 (Adding code), #4 (Code added to visual editor), #5 (Published code)
The official readme.txt is a good inspiration

rtsyntax/rtsyntax.php Passed 13 tests

The principal PHP file in "rtSyntax" v. 1.0.5 is loaded by WordPress automatically on each request
75 characters long description:
A no-fuss, lightweight, fast and optimised syntax highlighter for WordPress

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
No dangerous file extensions were detected2,546 lines of code in 32 files:
LanguageFilesBlank linesComment linesLines of code
CSS26334882,243
JavaScript381106
PHP11610103
HTML14083
YAML13911

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.02
Average class complexity3.00
▷ Minimum class complexity3.00
▷ Maximum class complexity3.00
Average method complexity1.17
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods12
▷ Static methods00.00%
▷ Public methods12100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
10 PNG files occupy 0.78MB with 0.41MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-3.png146.87KB68.69KB▼ 53.23%
img/rtkey.png1.14KB0.20KB▼ 82.83%
img/brown_papersq.png17.77KB9.92KB▼ 44.16%
screenshot-1.png61.94KB27.92KB▼ 54.92%
img/school_book.png0.47KB0.34KB▼ 27.37%