83% wp-syntax

Code Review | WP-Syntax

WordPress plugin WP-Syntax scored83%from 54 tests.

About plugin

  • Plugin page: wp-syntax
  • Plugin version: 1.2
  • PHP compatiblity: 5.6.20+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.4
  • WordPress version: 6.3.1
  • First release: Jan 21, 2007
  • Latest release: Dec 1, 2023
  • Number of updates: 221
  • Update frequency: every 27.9 days
  • Top authors: rmm5t (68.78%)shazahm1@hotmail.com (31.67%)

Code review

54 tests

User reviews

15 reviews

Install metrics

4,000+ active /342,581 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲0.54MB] [CPU: ▼10.43ms] Passed 4 tests

An overview of server-side resources used by WP-Syntax
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /4.05 ▲0.5838.18 ▼2.16
Dashboard /wp-admin3.89 ▲0.5445.78 ▼19.31
Posts /wp-admin/edit.php3.94 ▲0.5846.78 ▼0.63
Add New Post /wp-admin/post-new.php6.41 ▲0.5285.87 ▼19.62
Media Library /wp-admin/upload.php3.75 ▲0.5239.61 ▲8.27

Server storage [IO: ▲4.11MB] [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: 268 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-posts
db_upgraded
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by WP-Syntax
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,873 ▲12613.73 ▼0.538.29 ▲6.6640.58 ▼2.37
Dashboard /wp-admin2,186 ▲155.61 ▲0.0392.91 ▼7.8641.12 ▼1.66
Posts /wp-admin/edit.php2,100 ▼01.96 ▲0.0239.05 ▲1.3735.69 ▲0.80
Add New Post /wp-admin/post-new.php1,528 ▲223.28 ▲0.07673.02 ▲37.7853.92 ▲3.28
Media Library /wp-admin/upload.php1,403 ▼04.17 ▼0.0598.43 ▼2.6442.43 ▲0.31

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% 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
Almost there! Just fix the following items
  • 2169× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Warning
      Use of undefined constant GESHI_NUMBER_FLT_SCI_ZERO - assumed 'GESHI_NUMBER_FLT_SCI_ZERO' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-syntax/geshi/geshi/aimms.php on line 281
    • > PHP Warning
      Use of undefined constant GESHI_NUMBER_FLT_SCI_ZERO - assumed 'GESHI_NUMBER_FLT_SCI_ZERO' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-syntax/geshi/geshi/cpp-winapi.php on line 789
    • > PHP Warning
      Use of undefined constant GESHI_NUMBER_FLT_SCI_ZERO - assumed 'GESHI_NUMBER_FLT_SCI_ZERO' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-syntax/geshi/geshi/q.php on line 122
    • > PHP Warning
      Use of undefined constant GESHI_NEVER - assumed 'GESHI_NEVER' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-syntax/geshi/geshi/io.php on line 131
    • > 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/wp-syntax/geshi/geshi/hicest.php on line 66
    • > PHP Warning
      Use of undefined constant GESHI_NEVER - assumed 'GESHI_NEVER' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-syntax/geshi/geshi/css.php on line 931
    • > 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/wp-syntax/geshi/geshi/c_winapi.php on line 83
    • > 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/wp-syntax/geshi/geshi/q.php on line 119
    • > PHP Warning
      Use of undefined constant GESHI_NEVER - assumed 'GESHI_NEVER' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-syntax/geshi/geshi/smalltalk.php on line 147
    • > 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/wp-syntax/geshi/geshi/texgraph.php on line 42

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 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that need to be fixed:
  • Screenshots: Please add images for these screenshots: #1 (PHP, no line numbers.), #2 (Java, with line numbers.), #3 (Ruby, with line numbers starting at 18.)
The official readme.txt is a good inspiration

wp-syntax/wp-syntax.php 85% from 13 tests

The main PHP script in "WP-Syntax" version 1.2 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Text Domain: The text domain follows the same naming rules as the plugin slug: lowercase characters and dashes
  • Domain Path: The domain path folder was not found ("/lang")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected72,249 lines of code in 263 files:
LanguageFilesBlank linesComment linesLines of code
PHP2612,02914,91272,100
CSS19286
JavaScript1132063

PHP code 50% from 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Please tend to the following items
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 190)
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity225.33
▷ Minimum class complexity3.00
▷ Maximum class complexity638.00
Average method complexity6.86
▷ Minimum method complexity1.00
▷ Maximum method complexity190.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods115
▷ Static methods2017.39%
▷ Public methods9179.13%
▷ Protected methods2017.39%
▷ Private methods43.48%
Functions4
▷ Named functions375.00%
▷ Anonymous functions125.00%
Constants59
▷ Global constants59100.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
3 PNG files occupy 0.03MB with 0.02MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png10.63KB4.18KB▼ 60.66%
screenshot-2.png10.27KB4.40KB▼ 57.18%
screenshot-3.png10.23KB3.52KB▼ 65.55%