78% firmasite-theme-enhancer

Code Review | FirmaSite Theme Enhancer

WordPress plugin FirmaSite Theme Enhancer scored 78% from 54 tests.

About plugin

  • Plugin page: firmasite-theme-e...
  • Plugin version: 1.5.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.2
  • WordPress version: 5.8.1
  • First release: Mar 10, 2013
  • Latest release: Mar 8, 2015
  • Number of updates: 29
  • Update frequency: every 25.1 days
  • Top authors: unsalkorkmaz (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

1,000+ active / 35,687 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▼0.06MB] [CPU: ▼147.55ms] Passed 4 tests

A check of server-side resources used by FirmaSite Theme Enhancer
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.89 ▲0.1730.10 ▲9.97
Dashboard /wp-admin3.11 ▲0.0545.09 ▲1.26
Posts /wp-admin/edit.php3.20 ▲0.0943.41 ▼2.14
Add New Post /wp-admin/post-new.php5.01 ▼0.4266.99 ▼591.78
Media Library /wp-admin/upload.php3.05 ▲0.0533.52 ▲2.45

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 65 new files
Database: no new tables, 1 new option
New WordPress options
widget_simpleimage

Browser metrics Passed 4 tests

This is an overview of browser requirements for FirmaSite Theme Enhancer
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,694 ▲9816.03 ▲0.087.90 ▼2.9765.30 ▲18.82
Dashboard /wp-admin2,976 ▲455.98 ▼0.18133.93 ▼10.05107.60 ▼8.35
Posts /wp-admin/edit.php2,748 ▲92.71 ▲0.0069.80 ▲6.1786.44 ▼10.92
Add New Post /wp-admin/post-new.php1,683 ▼2,11518.90 ▲3.54371.44 ▼86.72113.85 ▲15.95
Media Library /wp-admin/upload.php1,816 ▲95.11 ▲0.06143.88 ▼8.64120.77 ▼6.71

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 1 option in the database
    • widget_simpleimage

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
The following issues need your attention
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/firmasite-theme-enhancer/simple-image-widget/templates/widget.php
    • > /wp-content/plugins/firmasite-theme-enhancer/wpeditor.php
  • 11× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/firmasite-theme-enhancer/widget-visibility/widget-conditions.php:521
    • > PHP Notice
      Undefined index: multiple_properties in wp-content/plugins/firmasite-theme-enhancer/theme-enhancer/functions/csstidy/data-wp.inc.php on line 34
    • > PHP Notice
      Undefined index: unit_values in wp-content/plugins/firmasite-theme-enhancer/theme-enhancer/functions/csstidy/data-wp.inc.php on line 16
    • > PHP Notice
      Undefined index: color_values in wp-content/plugins/firmasite-theme-enhancer/theme-enhancer/functions/csstidy/data-wp.inc.php on line 24
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/firmasite-theme-enhancer/simple-image-widget/includes/class-simple-image-widget.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/firmasite-theme-enhancer/simple-image-widget/simple-image-widget.php:28
    • > PHP Warning
      in_array() expects parameter 2 to be array, null given in wp-content/plugins/firmasite-theme-enhancer/theme-enhancer/functions/csstidy/data-wp.inc.php on line 24
    • > PHP Warning
      "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in wp-content/plugins/firmasite-theme-enhancer/theme-enhancer/functions/csstidy/class.csstidy.php on line 854
    • > PHP Warning
      in_array() expects parameter 2 to be array, null given in wp-content/plugins/firmasite-theme-enhancer/theme-enhancer/functions/csstidy/data-wp.inc.php on line 16
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/firmasite-theme-enhancer/theme-enhancer/functions/csstidy/data-wp.inc.php on line 34

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% 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
These attributes need your attention:
  • Tags: Too many tags (17 tag instead of maximum 10); only the first 5 tags are used in your directory listing
Please take inspiration from this readme.txt

firmasite-theme-enhancer/firmasite-plugin.php 92% from 13 tests

The principal PHP file in "FirmaSite Theme Enhancer" v. 1.5.0 is loaded by WordPress automatically on each request
The following require your attention:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("firmasite-theme-enhancer.php" instead of "firmasite-plugin.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin6,758 lines of code in 43 files:
LanguageFilesBlank linesComment linesLines of code
PHP195901,7613,788
CSS117314900
JavaScript612295782
SVG200687
PO File5236420601

PHP code 50% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
Please tend to the following items
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 148)
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity75.10
▷ Minimum class complexity1.00
▷ Maximum class complexity248.00
Average method complexity7.99
▷ Minimum method complexity1.00
▷ Maximum method complexity148.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods106
▷ Static methods1514.15%
▷ Public methods9993.40%
▷ Protected methods76.60%
▷ Private methods00.00%
Functions22
▷ Named functions22100.00%
▷ Anonymous functions00.00%
Constants10
▷ Global constants10100.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.16MB with 0.10MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png132.12KB55.46KB▼ 58.03%
screenshot-1.png35.88KB13.62KB▼ 62.03%