78% shamor

Code Review | Shamor

WordPress plugin Shamor scored78%from 54 tests.

About plugin

  • Plugin page: shamor
  • Plugin version: 1.8
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 2.0-6.1
  • WordPress version: 6.3.1
  • First release: Sep 29, 2022
  • Latest release: Sep 6, 2023
  • Number of updates: 32
  • Update frequency: every 10.7 days
  • Top authors: hatul (96.88%)shamor (6.25%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active /1,411 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.03MB] [CPU: ▼11.15ms] Passed 4 tests

Analyzing server-side resources used by Shamor
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.22 ▼0.2519.31 ▼17.76
Dashboard /wp-admin3.44 ▲0.0944.62 ▼14.89
Posts /wp-admin/edit.php3.55 ▲0.1949.84 ▲1.87
Add New Post /wp-admin/post-new.php6.02 ▲0.1383.97 ▼13.71
Media Library /wp-admin/upload.php3.36 ▲0.1334.63 ▲1.75

Server storage [IO: ▲68.07MB] [DB: ▲0.00MB] 67% from 3 tests

A short overview of filesystem and database impact
Please try to fix the following items
  • Total filesystem usage must be limited to 25MB (currently using 68.07MB)
Filesystem: 103 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for Shamor
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,472 ▼27413.21 ▼1.170.49 ▼1.1017.32 ▼22.75
Dashboard /wp-admin2,219 ▲315.84 ▲0.98106.83 ▼6.8539.28 ▼2.31
Posts /wp-admin/edit.php2,084 ▼52.00 ▼0.0538.69 ▼1.9233.90 ▼2.29
Add New Post /wp-admin/post-new.php1,546 ▲2523.09 ▼0.13678.57 ▲9.5461.87 ▲3.39
Media Library /wp-admin/upload.php1,404 ▲134.21 ▼0.00104.47 ▲6.9746.14 ▼0.15

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
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

SRP 0% 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 items
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/shamor/wp-shamor.php
  • 39× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'GeoIp2\\Record\\AbstractRecord' not found in wp-content/plugins/shamor/vendor/geoip2/geoip2/src/Record/Traits.php:118
    • > PHP Fatal error
      Uncaught Error: Class 'GeoIp2\\Model\\AbstractModel' not found in wp-content/plugins/shamor/vendor/geoip2/geoip2/src/Model/Country.php:33
    • > PHP Fatal error
      Uncaught Error: Class 'GeoIp2\\Exception\\GeoIp2Exception' not found in wp-content/plugins/shamor/vendor/geoip2/geoip2/src/Exception/AuthenticationException.php:10
    • > PHP Fatal error
      Uncaught Error: Interface 'GeoIp2\\ProviderInterface' not found in wp-content/plugins/shamor/vendor/geoip2/geoip2/src/Database/Reader.php:37
    • > PHP Fatal error
      Uncaught Error: Class 'MaxMind\\Exception\\HttpException' not found in wp-content/plugins/shamor/vendor/maxmind/web-service-common/src/Exception/InvalidRequestException.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'GeoIp2\\Model\\Country' not found in wp-content/plugins/shamor/vendor/geoip2/geoip2/src/Model/City.php:32
    • > PHP Fatal error
      Uncaught Error: Class 'GeoIp2\\Record\\AbstractPlaceRecord' not found in wp-content/plugins/shamor/vendor/geoip2/geoip2/src/Record/Continent.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'GeoIp2\\Model\\AbstractModel' not found in wp-content/plugins/shamor/vendor/geoip2/geoip2/src/Model/Domain.php:21
    • > PHP Fatal error
      require(): Failed opening required 'wp-content/plugins/shamor/vendor/geoip2/geoip2/examples/../vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/shamor/vendor/geoip2/geoip2/examples/benchmark.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'GeoIp2\\Model\\AbstractModel' not found in wp-content/plugins/shamor/vendor/geoip2/geoip2/src/Model/Asn.php:23

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need your attention:
  • Screenshots: Screenshot #1 (Dashboard) image required
Please take inspiration from this readme.txt

shamor/wp-shamor.php 92% from 13 tests

Analyzing the main PHP file in "Shamor" version 1.8
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("shamor.php" instead of "wp-shamor.php")

Code Analysis Passed 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 plugin5,618 lines of code in 90 files:
LanguageFilesBlank linesComment linesLines of code
PHP677572,0033,271
Markdown841801,029
C111825668
JSON600435
YAML313062
XML14059
Bourne Shell118038
m418032
JavaScript10016
C/C++ Header14128

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity8.11
▷ Minimum class complexity1.00
▷ Maximum class complexity60.00
Average method complexity2.97
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces14
Interfaces2
Traits0
Classes52
▷ Abstract classes35.77%
▷ Concrete classes4994.23%
▷ Final classes00.00%
Methods190
▷ Static methods3216.84%
▷ Public methods13772.11%
▷ Protected methods10.53%
▷ Private methods5227.37%
Functions6
▷ Named functions233.33%
▷ Anonymous functions466.67%
Constants22
▷ Global constants00.00%
▷ Class constants22100.00%
▷ Public constants418.18%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1 PNG file occupies 0.07MB with 0.05MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png75.13KB21.46KB▼ 71.43%