Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dramatically simplify the check whether we need to load scripts etc. #1871

Merged
merged 13 commits into from
Jan 13, 2015

Conversation

jdevalk
Copy link
Contributor

@jdevalk jdevalk commented Jan 7, 2015

As a result, also load the admin class more exclusively.

@omarreiss please review.

Joost de Valk added 2 commits January 7, 2015 11:15
As a result, also load the admin class more exclusively.
* @param bool $form Whether or not the form start tag should be included.
* @param string $option The long name of the option to use for the current page.
* @param string $optionshort The short name of the option to use for the current page.
* @param bool $contains_files Whether the form should allow for file uploads.
*/
Copy link
Contributor

Choose a reason for hiding this comment

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

What's up with the spacing ? Doc alignment check missing ?

$GLOBALS['wpseo_taxonomy'] = new WPSEO_Taxonomy;
}

if ( in_array( $pagenow, array( 'admin.php' ) ) ) {
// @todo [JRF => whomever] Can we load this more selectively ? like only when $_GET['page'] is one of ours ?
if ( 'admin.php' === $pagenow && strpos( (string) filter_input( INPUT_GET, 'page' ), 'wpseo' ) === 0 ) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Unfortunately we've already run into the fact that the filter extension is not always enabled, so this code cannot be used.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah right. ^%$^$.


private function load_tour() {
if ( isset( $_GET['wpseo_restart_tour'] ) ) {
$options['ignore_tour'] = false;
Copy link
Contributor

Choose a reason for hiding this comment

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

$this->options[...]

Joost de Valk added 6 commits January 7, 2015 14:48
Make `pagenow` a class var
Remove a lot of GLOBALS usage as it's unneeded
Make sure `wpseo_restart_tour` has a value as otherwise `filter_input` won't work on it.
…ectively

Conflicts:
	admin/class-admin.php
	admin/class-config.php
	wp-seo-main.php
@omarreiss omarreiss mentioned this pull request Jan 13, 2015
Joost de Valk added 3 commits January 13, 2015 15:32
move filter_input function to wpseo_utils
use validation emulation functions from that same class to truly mimic validate behaviour
omarreiss added a commit that referenced this pull request Jan 13, 2015
Dramatically simplify the check whether we need to load scripts etc.
@omarreiss omarreiss merged commit 6e93ace into trunk Jan 13, 2015
@omarreiss omarreiss deleted the load-admin-class-selectively branch January 13, 2015 14:56
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.

4 participants