Can not redirect to logout page - facebook-php-sdk

I have built a website integrated with Facebooks latest PHP SDK (3.0.1 i believe). I have had a lot of problems during authentication. I have successfully been able to login but i'm facing a problem logging out. I do not use any JavaScript. I need everything to be in PHP.
When i use the getLogoutUrl below, it doesnt seem to go back to the logout.php in my domain. It goes back to the index.php. Please tell me what i am doing wrong.
Thank you much!
$facebook->getLogoutUrl( array(
'redirect_uri' => 'http://mydomain/logout.php')
);

as of php sdk 3.0.1 its next for redirection
{$facebook->getLogoutUrl( array(
'next' => 'http://mydomain/logout.php')
);}

Related

wordpress repoint the URl to WP directory

I am designing a wordpress website. I am quite new in it. I made a mistake.
Generally the website points to wp directory which I mistakenly changed it to home. Now, it gives a 404 error.
I changed this https://sure2biz.com/wp to https://sure2biz.com/home.
Kindly tell me steps to point it back to wp.
If you are not able to acces your wordpress dashboard, go to your cpanel, PHP My Admin => Select your Database => Go to table WP OPTIONS => there you can replace URL

Redux Framework Warning in wordpress Theme and Theme customization options not working

Redux Framework Warning ace-editor-js CDN unavailable. Some controls may not render properly. Please wait a few minutes, then try refreshing the page. Unable to load some remotely hosted scripts This error accoured and Theme customization options not working and not display when click on options it will display blank.
I am begginer in wordpress, Anyone can give the suggestions why this error occured.
When I used Redux Framework Plugins Then All options are working.
I got solution from https://wordpress.org/support/topic/redux-framework-warning-cdn-unavailable
The above solution has nothing useful for me.
My solution was to disable the code snippet in my wp-config to restrict external url requests
define( 'WP_HTTP_BLOCK_EXTERNAL', true );
if ( WP_HTTP_BLOCK_EXTERNAL ) {
define( 'WP_ACCESSIBLE_HOSTS', '*.wordpress.org,*.example.com' );
}
Alternatively, I could add the CDN domain used by redux into the define...
For me - it resolved my problem.
My next idea would be to check the htaccess for Order Deny,Allow....

Wordpress plugin works only for logged users

I'm using Dave's Wordpress Live Search.
The problem I have, is live search - it works only for logged users. If i'm logged in, plugin works fine. I found this line:
'ajaxURL' => admin_url('admin-ajax.php', is_ssl()),
which mean plugin is using admin-ajax.php and i think unlogged users haven't access to it.
I tried to define ajaxURL without , is_ssl():
'ajaxURL' => admin_url('admin-ajax.php'),
but didn't help.
Is it a problem with access to wp-admin/admin-ajax.php? How can i change it?
This is old, but I was looking into this.
Rather than changing the core, you can duplicate the hooks of the plugin and add ''no_priv'' versions. I am sure this is more elegant than duplicating a file in the core.
See: http://codex.wordpress.org/AJAX_in_Plugins
From that page:
"Ajax on the Viewer-Facing Side
As of WordPress 2.8, there is a new hook similar to 'wp_ajax_my_action':
'wp_ajax_nopriv_my_action' executes for users that are not logged in.
So, if you want it to fire for both visitors and logged-in users, you can do this:
add_action('wp_ajax_my_action', 'my_action_callback');
add_action('wp_ajax_nopriv_my_action', 'my_action_callback');"
In your case I would clone admin-ajax.php and rename it and remove all admin related conditionals from the file.
More specific:
Make sure to include the new cloned file where required instead of
the old one.
Make sure also you are changing only the permissions
levels from the file.
The cloned file just put in the same directory as it is the admin-ajax.php, "wp-admin"
Good luck! :)

Drupal 7 - debugging hooks

I am in the process of making my own implementation of hook_taxonomy_term_insert($term) using a module. This works fine because I can add the following:
drupal_set_message( 'todo', 'status' );
which will show up fine. However, how can I debug my hook? For example I would like to var_dump the $term and start coding from there. But how do I stop the redirect, so that I am able to print out messages?
Thanks in advance.
Take a look at the Devel (development) module. It is extremely helpful in debugging. There is also an option to stop redirects so you can debug from there.

How do I completely disable cache?

Drupal 6's cache can be set to disabled, normal or aggressive. I cannot find these options for my Drupal 7 installation. There is only a button that flushes all the cache but it has to be clicked for every change I made to a module or a template. By change I mean adding some HTML tags to a module or a template.
Thanks to mirzu's response, I already installed the devel module but it doesn't work either. The only way I get so see my changes is by disabling and enabling the module.
The hello.module looks like:
function annotate_menu() {
$items = array();
$items['hello'] = array(
'title' => t('Hello world'),
'page callback' => 'hello_output',
'access arguments' => array('access content'),
);
return $items;
}
function hello_output() {
header('Content-type: text/plain; charset=UTF-8');
header('Content-Disposition: inline');
return 'annotate';
}
The template page-hello.tpl.php contains print $content;.
I access the page through http://localhost/test/hello.
Completely disable the cache and use the devel module and check the box that reads "rebuild the cache registry on each page load."
There are many different levels of caching involved.
The menu system is not actually a cache. If you change anything in hook_menu(), you need to rebuild it. devel.module provides a handy link for that in the development block.
Additionally, Drupal also caches hook implementation and many other things, which you can clear with another link in the development block or if you have drush installed, with "drush cc all". There is also a way to disable it completely but that could make your site quite slow: http://drupal.org/node/797346
In Drupal 7, you can check the 'Rebuild the theme registry on every page load' option in the configuration page (admin/config/development/devel) of the Devel module.

Resources