78% content-writer

Code Review | Content Writer

WordPress plugin Content Writer scored78%from 54 tests.

About plugin

  • Plugin page: content-writer
  • Plugin version: 3.6.5
  • PHP compatiblity: 5.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-5.8.1
  • WordPress version: 6.3.1
  • First release: Oct 12, 2017
  • Latest release: Oct 28, 2021
  • Number of updates: 101
  • Update frequency: every 14.6 days
  • Top authors: steadycontent (97.03%)rublon (3.96%)

Code review

54 tests

User reviews

7 reviews

Install metrics

600+ active /26,205 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
Installer ran successfully

Server metrics [RAM: ▼0.66MB] [CPU: ▼16.52ms] Passed 4 tests

A check of server-side resources used by Content Writer
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0136.09 ▼5.13
Dashboard /wp-admin3.32 ▲0.0252.53 ▲3.10
Posts /wp-admin/edit.php3.37 ▲0.0247.89 ▲0.28
Add New Post /wp-admin/post-new.php3.20 ▼2.6936.42 ▼61.05
Media Library /wp-admin/upload.php3.24 ▲0.0234.53 ▼0.19

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Content Writer
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,813 ▲7813.26 ▼1.474.46 ▲2.4741.70 ▼6.31
Dashboard /wp-admin2,207 ▲165.89 ▼0.00102.19 ▼9.8081.83 ▲36.76
Posts /wp-admin/edit.php2,108 ▲192.05 ▲0.0138.84 ▲3.8734.41 ▼1.12
Add New Post /wp-admin/post-new.php1,540 ▲2118.10 ▼4.96680.53 ▲20.6465.10 ▲2.23
Media Library /wp-admin/upload.php1,401 ▲134.20 ▼0.0098.39 ▲3.9146.39 ▲5.50

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 5× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/content-writer/lib/PDL/functions/SpecialMath.php
    • > /wp-content/plugins/content-writer/lib/PDL/GammaDistribution.php
    • > /wp-content/plugins/content-writer/lib/PDL/BetaDistribution.php
    • > /wp-content/plugins/content-writer/lib/conwr_writer_info.php
    • > /wp-content/plugins/content-writer/lib/PDL/ProbabilityDistribution.php
  • 21× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Notice
      Undefined variable: sc_connected in wp-content/plugins/content-writer/lib/conwr-general-settings.php on line 22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/content-writer/lib/conwr-general-settings.php:34
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/content-writer/lib/sc_api.php:1055
    • > PHP Fatal error
      Uncaught Error: Class 'nusoap_base' not found in wp-content/plugins/content-writer/lib/nusoap/class.soapclient.php:26
    • > PHP Fatal error
      Uncaught Error: Class 'nusoap_base' not found in wp-content/plugins/content-writer/lib/nusoap/class.soap_transport_http.php:15
    • > PHP Fatal error
      require_once(): Failed opening required 'Mail/mimeDecode.php' (include_path='.:/usr/share/php') in wp-content/plugins/content-writer/lib/nusoap/nusoapmime.php on line 42
    • > PHP Notice
      Undefined variable: sc_connected in wp-content/plugins/content-writer/lib/conwr-general-settings.php on line 30
    • > PHP Fatal error
      Uncaught Error: Class 'nusoap_base' not found in wp-content/plugins/content-writer/lib/nusoap/class.xmlschema.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'nusoap_base' not found in wp-content/plugins/content-writer/lib/nusoap/class.soap_server.php:16
    • > PHP Notice
      Undefined variable: sc_connected in wp-content/plugins/content-writer/lib/conwr-general-settings.php on line 5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 81% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that need to be fixed:
  • Contributors: The plugin contributors field is not present
  • Screenshots: Please add an image for screenshot #1 (Order content from SteadyContent and we'll deliver your content directly to your Wordpress blog.)
  • Tags: Too many tags (17 tag instead of maximum 10); only the first 5 tags are used in your directory listing
The official readme.txt might help

content-writer/content-writer.php Passed 13 tests

The main PHP script in "Content Writer" version 3.6.5 is automatically included on every request by WordPress
86 characters long description:
Allows users to order, post and socially share uniquely written content to their blog.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin20,167 lines of code in 40 files:
LanguageFilesBlank linesComment linesLines of code
PHP271,9995,87716,222
SVG1002,671
JavaScript714778703
CSS4568292
Sass1285279

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.51
Average class complexity73.35
▷ Minimum class complexity1.00
▷ Maximum class complexity389.00
Average method complexity8.63
▷ Minimum method complexity1.00
▷ Maximum method complexity82.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes37
▷ Abstract classes00.00%
▷ Concrete classes37100.00%
▷ Final classes00.00%
Methods351
▷ Static methods00.00%
▷ Public methods351100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions139
▷ Named functions139100.00%
▷ Anonymous functions00.00%
Constants22
▷ Global constants22100.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.06MB with 0.05MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/sc-logo20.png0.66KB0.74KB0.00%
assets/images/beaker-gray.png6.94KB0.35KB▼ 95.00%
assets/images/loser.png7.10KB0.33KB▼ 95.28%
assets/images/beaker-green.png7.05KB0.44KB▼ 93.71%
assets/images/beaker-blue.png7.08KB0.46KB▼ 93.43%