Skip to content

Fix critical PHPCS issues#197

Open
philcable wants to merge 10 commits into
developfrom
fix/critical-phpcs-issues
Open

Fix critical PHPCS issues#197
philcable wants to merge 10 commits into
developfrom
fix/critical-phpcs-issues

Conversation

@philcable
Copy link
Copy Markdown
Contributor

Changes proposed in this pull request

  • Adds a PHPCS configuration file
  • Updates and prepares SQL queries to meet PHPCS.

Review checklist

Copy link
Copy Markdown
Contributor

@alektrefi alektrefi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good.

However, the unit tests are failing now and there is an issue with the SQL statements in the Travis build that needs to be looked into.

Comment thread inc/upgrade.php Outdated
);

$results = $wpdb->get_results( $banner_query );
$results = $wpdb->get_results( 'SELECT post_id, meta_value FROM $wpdb->postmeta WHERE meta_key = "_bu_banner"' );
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@philcable The Unit tests are failing. It appears to be around this line and because the unit tests.

739FWordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '->postmeta WHERE meta_key = "_bu_banner"' at line 1 for query SELECT post_id, meta_value FROM $wpdb->postmeta WHERE meta_key = "_bu_banner" made by PHPUnit_TextUI_Command::main, PHPUnit_TextUI_Command->run, PHPUnit_TextUI_TestRunner->doRun, PHPUnit_Framework_TestSuite->run, PHPUnit_Framework_TestSuite->run, PHPUnit_Framework_TestCase->run, PHPUnit_Framework_TestResult->run, PHPUnit_Framework_TestCase->runBare, PHPUnit_Framework_TestCase->runTest, ReflectionMethod->invokeArgs, Tests_Responsive_Framework_Upgrades->test_responsive_upgrade_091, responsive_upgrade_091
740FFFFFF...         118 / 118 (100%)```

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stonybrookweb @philcable Oops, thanks for catching that!

I just addressed this in 95ddd4a by using " around the queries with interpolated $wpdb data. I'll do a quick check across the other projects to make sure that didn't pop up elsewhere.

8ddb4e5 then removes a piece from the unit tests that was ignoring incorrect use of $wpdb->prepare() and the tests are passing.

I left the conflict with the changelog as is for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants