*

oneloveb

  • ****
  • 112 posts
OC_ADMIN_FOLDER
« on: November 06, 2021, 08:43:37 AM »
I notice that

Once folder is renamed in file system, use OC_ADMIN_FOLDER in config.php to define name of new folder.
Example: define('OC_ADMIN_FOLDER', 'admi224');

The change of the OC-ADMIN doesn't work on the Plugin setting when you click to configure it will return to ERROE 404
Because the file still have oc-admin name somewhere

*

mwindey

  • *****
  • 485 posts
Re: OC_ADMIN_FOLDER
« Reply #1 on: November 06, 2021, 11:00:28 AM »
I had this too and solved it by looking in the index file of the plugin where the problem is. Find and replace all references to oc-admin to your newly chosen admin and upload file to plugin folder. This only works temporarily because if there is an update of the plugin the file gets overwritten.

*

oneloveb

  • ****
  • 112 posts
Re: OC_ADMIN_FOLDER
« Reply #2 on: November 06, 2021, 11:18:26 AM »
It will be good if a function can change all the oc-admin names in all files at once, why do we need to change the name of oc-admin anytime a change was made with over 30 Plugins

Thanks for your reponse

*

MB Themes

Re: OC_ADMIN_FOLDER
« Reply #3 on: November 06, 2021, 12:30:36 PM »
It does change, but plugin must use proper function for linkage.
If plugin use 'oc-admin', then it surely cannot work.
Best to check with plugin author, or if it is free plugin then list it there
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

mwindey

  • *****
  • 485 posts
Re: OC_ADMIN_FOLDER
« Reply #4 on: November 06, 2021, 12:50:51 PM »
@MB Themes

it is in multiple plugins like in radius search, backoffice-manager, make offer etc....
In the indexes there is for instance in make offer index file
Code: [Select]
  $text .= '<li><a href="' . osc_base_url() . 'oc-admin/index.php?page=plugins&action=renderplugin&file=make_offer/admin/configure.php"><i class="fa fa-wrench"></i><span>' . __('Configure', 'make_offer') . '</span></a></li>';
  $text .= '<li><a href="' . osc_base_url() . 'oc-admin/index.php?page=plugins&action=renderplugin&file=make_offer/admin/offers.php"><i class="fa fa-handshake-o"></i><span>' . __('Offers', 'make_offer') . '</span></a></li>';
  $text .= '</ul>';

You need to change it by hand in almost every plugin but it is not so hard to do......
Only things is as i mentioned above, that if there is an update user needs to be reminded to change that part of file has to been done.

VERY IMPORTANT is to also update robots.txt file to disallow robots: CHANGE Disallow: /oc-admin/   to Disallow: /newadmin folder/
« Last Edit: November 06, 2021, 02:01:54 PM by mwindey »

*

MB Themes

Re: OC_ADMIN_FOLDER
« Reply #5 on: November 06, 2021, 06:33:47 PM »
We will review plugins.
It would be fool to add ocadmin folder those name is not known to anyone, into robots.txt and expose this information, or?
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

mwindey

  • *****
  • 485 posts
Re: OC_ADMIN_FOLDER
« Reply #6 on: November 06, 2021, 08:41:41 PM »
I am not doing it but standard is in on yourownsite.com/robots.txt test it and oc-admin is shown
« Last Edit: November 06, 2021, 08:43:47 PM by mwindey »

*

MB Themes

Re: OC_ADMIN_FOLDER
« Reply #7 on: November 08, 2021, 10:04:55 AM »
@mwindey
Yes correct, but "oc-admin" is standard backoffice directory so if someone knows you have osclass and you have not changed backoffice directory, then it is known information.
But this new feature is here to make this information hidden.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

MB Themes

Re: OC_ADMIN_FOLDER
« Reply #8 on: November 08, 2021, 10:52:56 AM »
I see it is still in many plugins, maybe something has failed during updates.
Fix is easy, replace this:
Code: [Select]
osc_base_url() . 'oc-admin/index.php
with this:
Code: [Select]
osc_admin_base_url(true) . '

Applicable in all plugins.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

mwindey

  • *****
  • 485 posts
Re: OC_ADMIN_FOLDER
« Reply #9 on: November 08, 2021, 11:01:10 AM »
@MB Themes

Super! i didn't know that... So what you are saying is i don't need to disallow the new map in robots.txt and searchbots will not follow my new admin folder right?
I didn't put it in there yet but i was doubting if yes or if no  :-\
« Last Edit: November 08, 2021, 11:03:27 AM by mwindey »

*

MB Themes

Re: OC_ADMIN_FOLDER
« Reply #10 on: November 08, 2021, 11:02:08 AM »
@mwindey
It think it is better not to mention it in robots.txt
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots