74% wp-qiita

Code Review | WP Qiita

WordPress plugin WP Qiita scored74%from 54 tests.

About plugin

  • Plugin page: wp-qiita
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2-4.4
  • WordPress version: 6.3.1
  • First release: Dec 10, 2015
  • Latest release: Dec 10, 2015
  • Number of updates: 5
  • Update frequency: every 9.8 days
  • Top authors: ka2 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /797 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.00MB] [CPU: ▼2.76ms] Passed 4 tests

Server-side resources used by WP Qiita
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0040.16 ▲4.12
Dashboard /wp-admin3.31 ▲0.0046.42 ▼1.95
Posts /wp-admin/edit.php3.36 ▲0.0046.37 ▲0.23
Add New Post /wp-admin/post-new.php5.89 ▲0.0080.47 ▼12.20
Media Library /wp-admin/upload.php3.23 ▲0.0034.07 ▲2.89

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 27 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-comments
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for WP Qiita
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.16 ▼1.221.71 ▲0.0643.14 ▲0.89
Dashboard /wp-admin2,203 ▲185.79 ▼0.1198.31 ▼0.5139.33 ▼3.44
Posts /wp-admin/edit.php2,086 ▼62.02 ▲0.0135.06 ▼6.0531.94 ▼6.60
Add New Post /wp-admin/post-new.php1,538 ▲1923.29 ▲0.13678.67 ▲75.1371.90 ▲10.46
Media Library /wp-admin/upload.php1,391 ▼04.22 ▲0.0198.82 ▼2.5343.49 ▼2.94

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • The plugin did not uninstall gracefully
    • > Notice in wp-admin/includes/plugin.php+1259
    Undefined variable: file
  • Zombie WordPress options were found after uninstall: 6 options
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 8× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_die() in wp-content/plugins/wp-qiita/functions.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_die() in wp-content/plugins/wp-qiita/lib/main.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_die() in wp-content/plugins/wp-qiita/lib/widgets.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_die() in wp-content/plugins/wp-qiita/lib/utils.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/wp-qiita/wp-qiita.php:39
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_die() in wp-content/plugins/wp-qiita/lib/shortcodes.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_die() in wp-content/plugins/wp-qiita/lib/init.php:2
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/wp-qiita/templates/wp-qiita-options.php:4

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

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
2 plugin tags: qiita api v2, qiita

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

The entry point to "WP Qiita" version 1.0.0 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 198 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected3,379 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP94476232,427
PO File1188188490
CSS13626228
JavaScript12834200
SVG10034

PHP code Passed 2 tests

This is a short overview 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.42
Average class complexity68.80
▷ Minimum class complexity21.00
▷ Maximum class complexity228.00
Average method complexity4.73
▷ Minimum method complexity1.00
▷ Maximum method complexity31.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes120.00%
Methods91
▷ Static methods22.20%
▷ Public methods8593.41%
▷ Protected methods44.40%
▷ Private methods22.20%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
9 PNG files occupy 0.27MB with 0.15MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/qiita-access-token-2.png29.26KB12.36KB▼ 57.76%
assets/images/qiita-app-register-2.png34.94KB15.76KB▼ 54.89%
assets/images/wpqt-widget-view.png14.19KB8.11KB▼ 42.87%
assets/images/qiita-app-register-1.png31.59KB14.35KB▼ 54.59%
assets/images/qiita-app-register-3.png39.80KB13.65KB▼ 65.70%