67% ap-gist-api-code-insert

Code Review | Gist API Code insert

WordPress plugin Gist API Code insert scored67%from 54 tests.

About plugin

  • Plugin page: ap-gist-api-code-...
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.0-6.3
  • WordPress version: 6.3.1
  • First release: Feb 7, 2019
  • Latest release: Oct 5, 2023
  • Number of updates: 14
  • Update frequency: every 121.5 days
  • Top authors: pinchoalex (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /721 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.28MB] [CPU: ▼4.34ms] Passed 4 tests

Analyzing server-side resources used by Gist API Code insert
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.79 ▲0.3236.87 ▼2.70
Dashboard /wp-admin3.62 ▲0.3142.62 ▼4.44
Posts /wp-admin/edit.php3.67 ▲0.3151.55 ▲2.87
Add New Post /wp-admin/post-new.php6.15 ▲0.2682.78 ▼13.08
Media Library /wp-admin/upload.php3.48 ▲0.2538.80 ▲5.33

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 1,718 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for Gist API Code insert
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,844 ▲9814.40 ▲0.111.84 ▲0.2137.24 ▼5.88
Dashboard /wp-admin2,222 ▲344.86 ▼0.22110.14 ▲0.2342.46 ▲6.24
Posts /wp-admin/edit.php2,105 ▲132.02 ▼0.1033.42 ▼7.3432.96 ▼1.32
Add New Post /wp-admin/post-new.php6,368 ▲4,85428.05 ▲10.48917.21 ▲218.3756.80 ▲2.92
Media Library /wp-admin/upload.php1,407 ▲164.20 ▼0.0192.17 ▼4.0640.14 ▼4.82

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
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
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
  • 3× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/ap-gist-api-code-insert/src/templates/channel.blade.php
    • > /wp-content/plugins/ap-gist-api-code-insert/src/templates/channel-load.blade.php
    • > /wp-content/plugins/ap-gist-api-code-insert/src/templates/error.blade.php
  • 273× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Contracts\\Translation\\TranslatorInterface' not found in wp-content/plugins/ap-gist-api-code-insert/vendor/symfony/translation/IdentityTranslator.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon\\Translator' not found in wp-content/plugins/ap-gist-api-code-insert/vendor/nesbot/carbon/src/Carbon/TranslatorImmutable.php:18
    • > PHP Fatal error
      Uncaught Error: Interface 'Carbon\\CarbonInterface' not found in wp-content/plugins/ap-gist-api-code-insert/vendor/nesbot/carbon/src/Carbon/Carbon.php:510
    • > PHP Fatal error
      Uncaught Error: Interface 'Carbon\\Exceptions\\InvalidArgumentException' not found in wp-content/plugins/ap-gist-api-code-insert/vendor/nesbot/carbon/src/Carbon/Exceptions/NotLocaleAwareException.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Illuminate\\Support\\Facades\\Facade' not found in wp-content/plugins/ap-gist-api-code-insert/vendor/illuminate/support/Facades/Validator.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'Illuminate\\Support\\Facades\\Facade' not found in wp-content/plugins/ap-gist-api-code-insert/vendor/illuminate/support/Facades/Crypt.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\Translation\\Exception\\RuntimeException' not found in wp-content/plugins/ap-gist-api-code-insert/vendor/symfony/translation/Exception/ProviderException.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Illuminate\\Support\\Facades\\Facade' not found in wp-content/plugins/ap-gist-api-code-insert/vendor/illuminate/support/Facades/RateLimiter.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Illuminate\\Bus\\PendingBatch' not found in wp-content/plugins/ap-gist-api-code-insert/vendor/illuminate/support/Testing/Fakes/PendingBatchFake.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\Translation\\Dumper\\FileDumper' not found in wp-content/plugins/ap-gist-api-code-insert/vendor/symfony/translation/Dumper/JsonFileDumper.php:21

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

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
3 plugin tags: github, gist, code highlight

ap-gist-api-code-insert/social-patch.php 77% from 13 tests

The main PHP file in "Gist API Code insert" ver. 1.0.0 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Domain Path: The domain path points to an invalid folder, "/languages" does not exist
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("ap-gist-api-code-insert.php" instead of "social-patch.php")

Code Analysis 3% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Almost there! Just fix the following issues
  • You should never include executable (binary) or otherwise dangerous files in your plugin
    • .bat - Batch File in Windows
      • wp-content/plugins/ap-gist-api-code-insert/vendor/nesbot/carbon/bin/carbon.bat
85,735 lines of code in 1,496 files:
LanguageFilesBlank linesComment linesLines of code
PHP1,42212,75844,89059,682
JSON300020,339
XSD392482,803
JavaScript991841,241
Markdown1940911,025
SVG200257
Sass2330218
Blade35087
reStructuredText1747874
DOS Batch1004
CSS3003
YAML1002

PHP code 50% from 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
It is recommended to fix the following
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 140)
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity8.81
▷ Minimum class complexity1.00
▷ Maximum class complexity323.00
Average method complexity2.28
▷ Minimum method complexity1.00
▷ Maximum method complexity140.00
Code structure
Namespaces102
Interfaces149
Traits62
Classes360
▷ Abstract classes246.67%
▷ Concrete classes33693.33%
▷ Final classes4011.90%
Methods4,251
▷ Static methods70416.56%
▷ Public methods3,56383.82%
▷ Protected methods54512.82%
▷ Private methods1433.36%
Functions668
▷ Named functions14121.11%
▷ Anonymous functions52778.89%
Constants208
▷ Global constants125.77%
▷ Class constants19694.23%
▷ Public constants19197.45%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
2 PNG files occupy 0.03MB with 0.02MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png16.67KB8.79KB▼ 47.30%
screenshot-1.png15.16KB6.33KB▼ 58.22%