79% writing-on-github

Code Review | Writing On GitHub

WordPress plugin Writing On GitHub scored79%from 54 tests.

About plugin

  • Plugin page: writing-on-github
  • Plugin version: 1.11
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9-5.4
  • WordPress version: 6.3.1
  • First release: Mar 21, 2017
  • Latest release: Apr 6, 2020
  • Number of updates: 51
  • Update frequency: every 21.7 days
  • Top authors: litefeel (94.12%)lite3 (7.84%)

Code review

54 tests

User reviews

3 reviews

Install metrics

20+ active /1,951 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.04MB] [CPU: ▼4.89ms] Passed 4 tests

A check of server-side resources used by Writing On GitHub
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0438.02 ▲0.52
Dashboard /wp-admin3.35 ▲0.0543.01 ▼10.26
Posts /wp-admin/edit.php3.46 ▲0.1145.92 ▼3.64
Add New Post /wp-admin/post-new.php5.94 ▲0.0587.03 ▼6.16
Media Library /wp-admin/upload.php3.27 ▲0.0437.13 ▲1.15
Writing On GitHub /wp-admin/options-general.php?page=writing-on-github3.2836.09

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Writing On GitHub
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.35 ▼0.041.70 ▼0.0241.94 ▼5.52
Dashboard /wp-admin2,202 ▲285.62 ▲0.0491.50 ▼15.8542.43 ▲1.61
Posts /wp-admin/edit.php2,104 ▲42.02 ▲0.0440.22 ▼0.4037.35 ▲0.56
Add New Post /wp-admin/post-new.php1,531 ▼622.98 ▲4.80666.66 ▲0.0549.34 ▼14.01
Media Library /wp-admin/upload.php1,407 ▲44.17 ▼0.2596.24 ▼3.8845.14 ▲3.28
Writing On GitHub /wp-admin/options-general.php?page=writing-on-github9772.1228.1234.04

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
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% 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 take a closer look at the following
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/writing-on-github/vendor/mustangostang/spyc/php4/5to4.php
    • > /wp-content/plugins/writing-on-github/vendor/mustangostang/spyc/examples/yaml-load.php
  • 15× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/writing-on-github/views/user-setting-field.php:1
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/writing-on-github/vendor/mustangostang/spyc/tests/DumpTest.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/writing-on-github/views/options.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/writing-on-github/views/checkbox-setting-field.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Writing_On_GitHub_Base_Client' not found in wp-content/plugins/writing-on-github/lib/client/fetch.php:10
    • > PHP Warning
      file_get_contents(../spyc.php): failed to open stream: No such file or directory in wp-content/plugins/writing-on-github/vendor/mustangostang/spyc/php4/5to4.php on line 6
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/writing-on-github/vendor/mustangostang/spyc/tests/ParseTest.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/writing-on-github/views/setting-field.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/writing-on-github/views/textarea-setting-field.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Writing_On_GitHub_Base_Client' not found in wp-content/plugins/writing-on-github/lib/client/persist.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
7 plugin tags: github, content, git, writing, collaboration...

writing-on-github/writing-on-github.php Passed 13 tests

The principal PHP file in "Writing On GitHub" v. 1.11 is loaded by WordPress automatically on each request
67 characters long description:
A WordPress plugin to allow you writing on GitHub (or Jekyll site).

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected4,792 lines of code in 53 files:
LanguageFilesBlank linesComment linesLines of code
PHP441,2232,1944,483
YAML57234196
JSON20084
Markdown19021
XML1008

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity23.19
▷ Minimum class complexity1.00
▷ Maximum class complexity263.00
Average method complexity2.54
▷ Minimum method complexity1.00
▷ Maximum method complexity40.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes27
▷ Abstract classes00.00%
▷ Concrete classes27100.00%
▷ Final classes00.00%
Methods389
▷ Static methods143.60%
▷ Public methods30778.92%
▷ Protected methods338.48%
▷ Private methods4912.60%
Functions15
▷ Named functions1280.00%
▷ Anonymous functions320.00%
Constants9
▷ Global constants111.11%
▷ Class constants888.89%
▷ Public constants8100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG images were found in this plugin