72% gianism

Code Review | Gianism

WordPress plugin Gianism scored72%from 54 tests.

About plugin

  • Plugin page: gianism
  • Plugin version: 5.1.0
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-6.2
  • WordPress version: 6.3.1
  • First release: Dec 21, 2011
  • Latest release: May 25, 2023
  • Number of updates: 129
  • Update frequency: every 32.4 days
  • Top authors: Takahashi_Fumiki (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

1,000+ active /36,465 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲1.56MB] [CPU: ▲9.43ms] Passed 4 tests

A check of server-side resources used by Gianism
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /4.99 ▲1.5353.80 ▲3.99
Dashboard /wp-admin4.89 ▲1.5957.20 ▲4.96
Posts /wp-admin/edit.php4.94 ▲1.5958.92 ▲13.61
Add New Post /wp-admin/post-new.php7.41 ▲1.53106.94 ▲18.47
Media Library /wp-admin/upload.php4.82 ▲1.5949.74 ▲15.17
Gianism Setting /wp-admin/options-general.php?page=gianism4.7450.48

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 1,470 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
db_upgraded
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for Gianism
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,813 ▲2714.62 ▲0.421.87 ▼0.0942.27 ▼4.26
Dashboard /wp-admin2,216 ▲395.68 ▲0.0194.97 ▼4.2237.72 ▼5.76
Posts /wp-admin/edit.php2,124 ▲242.19 ▲0.1739.83 ▲2.9638.55 ▲3.28
Add New Post /wp-admin/post-new.php1,548 ▲1423.09 ▲4.86620.94 ▼28.9558.05 ▼13.62
Media Library /wp-admin/upload.php1,424 ▲214.32 ▲0.20100.34 ▲0.7043.76 ▼0.94
Gianism Setting /wp-admin/options-general.php?page=gianism1,4516.40167.92158.63

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
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 25% 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 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 perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/gianism/wp-gianism.php
  • 944× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Google\\Collection' not found in wp-content/plugins/gianism/vendor/google/apiclient-services/src/Analytics/AccountSummary.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Exception\\RequestException' not found in wp-content/plugins/gianism/vendor/guzzlehttp/guzzle/src/Exception/BadResponseException.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Google\\Model' not found in wp-content/plugins/gianism/vendor/google/apiclient-services/src/GoogleAnalyticsAdmin/GoogleAnalyticsAdminV1alphaEnhancedMeasurementSettings.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'Google\\Model' not found in wp-content/plugins/gianism/vendor/google/apiclient-services/src/AnalyticsReporting/Segment.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'Google\\Collection' not found in wp-content/plugins/gianism/vendor/google/apiclient-services/src/Analytics/WebPropertySummary.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'Google\\Model' not found in wp-content/plugins/gianism/vendor/google/apiclient-services/src/Analytics/AccountTreeResponse.php:20
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\ClientInterface' not found in wp-content/plugins/gianism/vendor/guzzlehttp/guzzle/src/Client.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Google\\Model' not found in wp-content/plugins/gianism/vendor/google/apiclient-services/src/GoogleAnalyticsAdmin/GoogleAnalyticsAdminV1alphaIosAppDataStream.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'Google\\Model' not found in wp-content/plugins/gianism/vendor/google/apiclient-services/src/GoogleAnalyticsAdmin/GoogleAnalyticsAdminV1alphaAcknowledgeUserDataCollectionRequest.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'Google\\Collection' not found in wp-content/plugins/gianism/vendor/google/apiclient-services/src/Analytics/AccountPermissions.php:20

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please take a look at the following user-side issues
    • > GET request to /wp-admin/options-general.php?page=gianism
    • > Security (warning) in unknown
    security - Error with Permissions-Policy header: Unrecognized feature: 'ambient-light-sensor'.
    • > GET request to /wp-admin/options-general.php?page=gianism
    • > Security (warning) in unknown
    security - Error with Permissions-Policy header: Unrecognized feature: 'bluetooth'.

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
8 plugin tags: account, social, google, twitter, facebook...

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

The main file in "Gianism" v. 5.1.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("gianism.php" instead of "wp-gianism.php")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
There were no executable files found in this plugin106,610 lines of code in 1,408 files:
LanguageFilesBlank linesComment linesLines of code
PHP1,33016,23674,60894,686
Markdown211,26703,758
JSON27002,622
Sass8708282,486
PO File15028661,337
SVG3031,298
JavaScript104665362
XML43155
Bourne Shell1203
CSS33163

PHP code 50% from 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Please tend to the following items
  • Method cyclomatic complexity should be reduced to less than 100 (currently 104)
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity8.00
▷ Minimum class complexity1.00
▷ Maximum class complexity670.00
Average method complexity2.10
▷ Minimum method complexity1.00
▷ Maximum method complexity104.00
Code structure
Namespaces115
Interfaces56
Traits20
Classes1,226
▷ Abstract classes23218.92%
▷ Concrete classes99481.08%
▷ Final classes666.64%
Methods7,971
▷ Static methods7469.36%
▷ Public methods6,90886.66%
▷ Protected methods5156.46%
▷ Private methods5486.87%
Functions225
▷ Named functions5424.00%
▷ Anonymous functions17176.00%
Constants576
▷ Global constants111.91%
▷ Class constants56598.09%
▷ Public constants51691.33%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
8 compressed PNG files occupy 0.03MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/brands/line.png1.13KB1.32KB0.00%
src/img/header.png12.40KB11.01KB▼ 11.23%
assets/img/header.png11.48KB11.01KB▼ 4.12%
assets/img/hametuha-logo.png1.32KB1.29KB▼ 1.85%
src/img/brands/line.png2.04KB1.32KB▼ 35.17%