79% remote-snippets

Code Review | Remote Snippets

WordPress plugin Remote Snippets scored79%from 54 tests.

About plugin

  • Plugin page: remote-snippets
  • Plugin version: 1.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-5.3.2
  • WordPress version: 6.3.1
  • First release: Jan 31, 2020
  • Latest release: Jan 31, 2020
  • Number of updates: 7
  • Update frequency: N/A
  • Top authors: rgjo7n (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /676 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.20MB] [CPU: ▼6.44ms] Passed 4 tests

A check of server-side resources used by Remote Snippets
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.67 ▲0.2144.66 ▼2.06
Dashboard /wp-admin3.50 ▲0.1651.92 ▼10.93
Posts /wp-admin/edit.php3.62 ▲0.2648.72 ▼0.52
Add New Post /wp-admin/post-new.php6.12 ▲0.2388.17 ▼12.25
Media Library /wp-admin/upload.php3.43 ▲0.2039.02 ▲4.48
Add New RemoteSnippet /wp-admin/post-new.php?post_type=remotesnippets3.5145.50
RemoteSnippets /wp-admin/edit.php?post_type=remotesnippets3.4742.63

Server storage [IO: ▲0.75MB] [DB: ▲0.31MB] Passed 3 tests

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 380 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
db_upgraded
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for Remote Snippets
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,819 ▲8414.35 ▲0.161.70 ▼0.2244.06 ▼5.74
Dashboard /wp-admin2,219 ▲425.55 ▼0.0897.23 ▲7.3542.08 ▼2.97
Posts /wp-admin/edit.php2,127 ▲302.04 ▲0.0735.40 ▲0.7736.08 ▲0.15
Add New Post /wp-admin/post-new.php1,549 ▲1423.06 ▲4.57658.23 ▲4.9060.43 ▼11.20
Media Library /wp-admin/upload.php1,427 ▲304.12 ▼0.08111.43 ▲7.5050.73 ▲7.51
Add New RemoteSnippet /wp-admin/post-new.php?post_type=remotesnippets2,2633.9981.0450.13
RemoteSnippets /wp-admin/edit.php?post_type=remotesnippets1,1071.8932.5931.02

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These server-side errors were triggered
    • > GET request to /wp-admin/post-new.php?post_type=remotesnippets
    • > Warning in wp-content/plugins/remote-snippets/src/PostMetaData.php+162
    Illegal string offset 'remotesnippet_ds'
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=remotesnippets
    • > Notice in wp-content/plugins/remote-snippets/src/PostMetaData.php+231
    Uninitialized string offset: 0
    • > GET request to /wp-admin/post-new.php?post_type=remotesnippets
    • > Warning in wp-content/plugins/remote-snippets/src/PostMetaData.php+182
    Illegal string offset 'remotesnippet_ds_url'
    • > GET request to /wp-admin/post-new.php?post_type=remotesnippets
    • > Warning in wp-content/plugins/remote-snippets/src/PostMetaData.php+194
    Illegal string offset 'remotesnippet_cache_enable'
    • > GET request to /wp-admin/post-new.php?post_type=remotesnippets
    • > Warning in wp-content/plugins/remote-snippets/src/PostMetaData.php+196
    Illegal string offset 'remotesnippet_cache_timeout'
    • > GET request to /wp-admin/post-new.php?post_type=remotesnippets
    • > Warning in wp-content/plugins/remote-snippets/src/PostMetaData.php+231
    Illegal string offset 'remotesnippet_error_handling'

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 148× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'RS_Vendor\\Twig\\Extra\\Markdown\\MarkdownInterface' not found in wp-content/plugins/remote-snippets/thirdparty/twig/markdown-extra/src/DefaultMarkdown.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'RS_Vendor\\Twig\\TokenParser\\AbstractTokenParser' not found in wp-content/plugins/remote-snippets/thirdparty/twig/twig/src/TokenParser/FlushTokenParser.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'RS_Vendor\\Twig\\Extension\\AbstractExtension' not found in wp-content/plugins/remote-snippets/thirdparty/twig/twig/src/Extension/OptimizerExtension.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'RS_Vendor\\Twig\ode\\Expression\\Binary\\AbstractBinary' not found in wp-content/plugins/remote-snippets/thirdparty/twig/twig/src/Node/Expression/Binary/NotInBinary.php:14
    • > PHP Fatal error
      Uncaught Error: Interface 'RS_Vendor\\Twig\\Loader\\LoaderInterface' not found in wp-content/plugins/remote-snippets/thirdparty/twig/twig/src/Loader/FilesystemLoader.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'RS_Vendor\\Twig\ode\\Expression\\AbstractExpression' not found in wp-content/plugins/remote-snippets/thirdparty/twig/twig/src/Node/Expression/InlinePrint.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'RS_Vendor\\Twig\\Extension\\AbstractExtension' not found in wp-content/plugins/remote-snippets/thirdparty/twig/twig/src/Extension/ProfilerExtension.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'RS_Vendor\\Twig\\TokenParser\\AbstractTokenParser' not found in wp-content/plugins/remote-snippets/thirdparty/twig/twig/src/TokenParser/ForTokenParser.php:32
    • > PHP Fatal error
      Uncaught Error: Class 'RS_Vendor\\Twig\ode\ode' not found in wp-content/plugins/remote-snippets/thirdparty/twig/twig/src/Node/FlushNode.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'RS_Vendor\\Twig\\Error\\Error' not found in wp-content/plugins/remote-snippets/thirdparty/twig/twig/src/Error/SyntaxError.php:19

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 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
8 plugin tags: template, twig, csv, connect, webservice...

remote-snippets/remote-snippets.php Passed 13 tests

The main PHP script in "Remote Snippets" version 1.0.3 is automatically included on every request by WordPress
138 characters long description:
Import JSON and CSV data and display it using a Twig template. Consume API's and Webservices and display live data on your Wordpress site.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Success! There were no dangerous files found in this plugin13,860 lines of code in 377 files:
LanguageFilesBlank linesComment linesLines of code
PHP3748934,82813,767
Markdown132054
JSON20039

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity4.77
▷ Minimum class complexity1.00
▷ Maximum class complexity186.00
Average method complexity2.65
▷ Minimum method complexity1.00
▷ Maximum method complexity29.00
Code structure
Namespaces24
Interfaces15
Traits0
Classes353
▷ Abstract classes92.55%
▷ Concrete classes34497.45%
▷ Final classes5014.53%
Methods878
▷ Static methods283.19%
▷ Public methods71481.32%
▷ Protected methods9610.93%
▷ Private methods687.74%
Functions64
▷ Named functions5281.25%
▷ Anonymous functions1218.75%
Constants50
▷ Global constants12.00%
▷ Class constants4998.00%
▷ Public constants49100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG files were detected