Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
524 views
in Q2A Core by
edited by

"Admin" > "General" page is slow. This is caused by neat URL check. I hope that check code is stoped by some admin option. This option is not used after initial setup.

Related question: Improvement-suggestion-of-plugin-version-check-in-v1-7

Q2A version: 1.6.3

1 Answer

+2 votes
by
edited by

I will post hack source for the person who has been already troubled.

qa-include/qa-app-options.php (L360) : Add 1 line

'neat_url_check' => 1, // Add ASKIVE

qa-include/qa-lang-options.php (L261) : Add 1 line

'neat_url_check' => 'URL structure check', // Add ASKIVE

qa-include/qa-page-admin-default.php:

Add 1 line (L217) 

'neat_url_check' => 'checkbox', // Add ASKIVE
Replace 1 line (L281)
//$showoptions=array('site_title', 'site_url', 'neat_urls', 'site_language', 'site_theme', 'site_theme_mobile', 'tags_or_categories', 'site_maintenance');
$showoptions=array('site_title', 'site_url', 'neat_urls', 'site_language', 'site_theme', 'site_theme_mobile', 'tags_or_categories', 'site_maintenance', 'neat_url_check');  // Replace ASKIVE
Replace some lines (L970)
foreach ($rawoptions as $rawoption)
// Replace [start] ASKIVE
/*
$neatoptions[$rawoption]=
'<iframe src="'.qa_path_html('url/test/'.QA_URL_TEST_STRING, array('dummy' => '', 'param' => QA_URL_TEST_STRING), null, $rawoption).'" width="20" height="16" style="vertical-align:middle; border:0" scrolling="no" frameborder="0"></iframe>&nbsp;'.
'<small>'.
qa_html(urldecode(qa_path('123/why-do-birds-sing', null, '/', $rawoption))).
(($rawoption==QA_URL_FORMAT_NEAT) ? strtr(qa_lang_html('admin/neat_urls_note'), array(
'^1' => '<a href="http://www.question2answer.org/htaccess.php" target="_blank">',
'^2' => '</a>',
)) : '').
'</small>';
*/
if(qa_opt('neat_url_check'))
  $neatoptions[$rawoption]=
'<iframe src="'.qa_path_html('url/test/'.QA_URL_TEST_STRING, array('dummy' => '', 'param' => QA_URL_TEST_STRING), null, $rawoption).'" width="20" height="16" style="vertical-align:middle; border:0" scrolling="no" frameborder="0"></iframe>&nbsp;'.
'<small>'.
qa_html(urldecode(qa_path('123/why-do-birds-sing', null, '/', $rawoption))).
(($rawoption==QA_URL_FORMAT_NEAT) ? strtr(qa_lang_html('admin/neat_urls_note'), array(
'^1' => '<a href="http://www.question2answer.org/htaccess.php" target="_blank">',
'^2' => '</a>',
)) : '').
'</small>';
else
  $neatoptions[$rawoption]=
'<small>'.
qa_html(urldecode(qa_path('123/why-do-birds-sing', null, '/', $rawoption))).
(($rawoption==QA_URL_FORMAT_NEAT) ? strtr(qa_lang_html('admin/neat_urls_note'), array(
'^1' => '<a href="http://www.question2answer.org/htaccess.php" target="_blank">',
'^2' => '</a>',
)) : '').
'</small>';
// Replace [end] ASKIVE
Add 1 line (L1007)
if(qa_opt('neat_url_check')) // Add ASKIVE
  $optionfield['note']=qa_lang_html_sub('admin/url_format_note', '<span style=" '.qa_admin_url_test_html().'/span>');
...